<!DOCTYPE html>
<html class="theme-next muse use-motion" lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">















  
  
  <link href="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/jquery.css" rel="stylesheet" type="text/css">




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/css.css" rel="stylesheet" type="text/css">
  






<link href="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/font-awesome.css" rel="stylesheet" type="text/css">

<link href="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/main.css" rel="stylesheet" type="text/css">


  <meta name="keywords" content="Stats,MachineLearning,LinearRegression,">








  <link rel="shortcut icon" type="image/x-icon" href="http://fangs.in/favicon.ico?v=5.1.2">






<meta name="description" content="机器学习要解决的问题，可以分为回归（Regression）和分类（Classification）两种类型，为了解决这些问题，数据科学领域的专家们研究出了很多算法，线性回归很可能是其中最简单的一种，而工作、生活中许多简单问题往往用不上多么复杂的模型，让我们从最简单的线性回归说起。">
<meta name="keywords" content="Stats,MachineLearning,LinearRegression">
<meta property="og:type" content="article">
<meta property="og:title" content="从线性回归说起">
<meta property="og:url" content="http://fangs.in/post/thinkstats/ml_0_linearregression/index.html">
<meta property="og:site_name" content="Cesco: a minimal blog">
<meta property="og:description" content="机器学习要解决的问题，可以分为回归（Regression）和分类（Classification）两种类型，为了解决这些问题，数据科学领域的专家们研究出了很多算法，线性回归很可能是其中最简单的一种，而工作、生活中许多简单问题往往用不上多么复杂的模型，让我们从最简单的线性回归说起。">
<meta property="og:locale" content="en">
<meta property="og:image" content="http://fangs.in/images/LinearRegression/cost.png">
<meta property="og:updated_time" content="2017-08-28T03:08:22.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="从线性回归说起">
<meta name="twitter:description" content="机器学习要解决的问题，可以分为回归（Regression）和分类（Classification）两种类型，为了解决这些问题，数据科学领域的专家们研究出了很多算法，线性回归很可能是其中最简单的一种，而工作、生活中许多简单问题往往用不上多么复杂的模型，让我们从最简单的线性回归说起。">
<meta name="twitter:image" content="http://fangs.in/images/LinearRegression/cost.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    sidebar: {"position":"left","display":"post","offset":12,"offset_float":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: 'Author'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://fangs.in/post/thinkstats/ml_0_linearregression/">





  <title>从线性回归说起 | Cesco: a minimal blog</title>
  














<script src="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/embed.js" data-timestamp="1565318453708"></script><script type="text/javascript" async="" src="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/MathJax.js"></script><style type="text/css">.fancybox-margin{margin-right:15px;}</style><style type="text/css">.MathJax_Hover_Frame {border-radius: .25em; -webkit-border-radius: .25em; -moz-border-radius: .25em; -khtml-border-radius: .25em; box-shadow: 0px 0px 15px #83A; -webkit-box-shadow: 0px 0px 15px #83A; -moz-box-shadow: 0px 0px 15px #83A; -khtml-box-shadow: 0px 0px 15px #83A; border: 1px solid #A6D ! important; display: inline-block; position: absolute}
.MathJax_Menu_Button .MathJax_Hover_Arrow {position: absolute; cursor: pointer; display: inline-block; border: 2px solid #AAA; border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -khtml-border-radius: 4px; font-family: 'Courier New',Courier; font-size: 9px; color: #F0F0F0}
.MathJax_Menu_Button .MathJax_Hover_Arrow span {display: block; background-color: #AAA; border: 1px solid; border-radius: 3px; line-height: 0; padding: 4px}
.MathJax_Hover_Arrow:hover {color: white!important; border: 2px solid #CCC!important}
.MathJax_Hover_Arrow:hover span {background-color: #CCC!important}
</style><style type="text/css">#MathJax_About {position: fixed; left: 50%; width: auto; text-align: center; border: 3px outset; padding: 1em 2em; background-color: #DDDDDD; color: black; cursor: default; font-family: message-box; font-size: 120%; font-style: normal; text-indent: 0; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; z-index: 201; border-radius: 15px; -webkit-border-radius: 15px; -moz-border-radius: 15px; -khtml-border-radius: 15px; box-shadow: 0px 10px 20px #808080; -webkit-box-shadow: 0px 10px 20px #808080; -moz-box-shadow: 0px 10px 20px #808080; -khtml-box-shadow: 0px 10px 20px #808080; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')}
#MathJax_About.MathJax_MousePost {outline: none}
.MathJax_Menu {position: absolute; background-color: white; color: black; width: auto; padding: 5px 0px; border: 1px solid #CCCCCC; margin: 0; cursor: default; font: menu; text-align: left; text-indent: 0; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; z-index: 201; border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px; -khtml-border-radius: 5px; box-shadow: 0px 10px 20px #808080; -webkit-box-shadow: 0px 10px 20px #808080; -moz-box-shadow: 0px 10px 20px #808080; -khtml-box-shadow: 0px 10px 20px #808080; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')}
.MathJax_MenuItem {padding: 1px 2em; background: transparent}
.MathJax_MenuArrow {position: absolute; right: .5em; padding-top: .25em; color: #666666; font-size: .75em}
.MathJax_MenuActive .MathJax_MenuArrow {color: white}
.MathJax_MenuArrow.RTL {left: .5em; right: auto}
.MathJax_MenuCheck {position: absolute; left: .7em}
.MathJax_MenuCheck.RTL {right: .7em; left: auto}
.MathJax_MenuRadioCheck {position: absolute; left: .7em}
.MathJax_MenuRadioCheck.RTL {right: .7em; left: auto}
.MathJax_MenuLabel {padding: 1px 2em 3px 1.33em; font-style: italic}
.MathJax_MenuRule {border-top: 1px solid #DDDDDD; margin: 4px 3px}
.MathJax_MenuDisabled {color: GrayText}
.MathJax_MenuActive {background-color: #606872; color: white}
.MathJax_MenuDisabled:focus, .MathJax_MenuLabel:focus {background-color: #E8E8E8}
.MathJax_ContextMenu:focus {outline: none}
.MathJax_ContextMenu .MathJax_MenuItem:focus {outline: none}
#MathJax_AboutClose {top: .2em; right: .2em}
.MathJax_Menu .MathJax_MenuClose {top: -10px; left: -10px}
.MathJax_MenuClose {position: absolute; cursor: pointer; display: inline-block; border: 2px solid #AAA; border-radius: 18px; -webkit-border-radius: 18px; -moz-border-radius: 18px; -khtml-border-radius: 18px; font-family: 'Courier New',Courier; font-size: 24px; color: #F0F0F0}
.MathJax_MenuClose span {display: block; background-color: #AAA; border: 1.5px solid; border-radius: 18px; -webkit-border-radius: 18px; -moz-border-radius: 18px; -khtml-border-radius: 18px; line-height: 0; padding: 8px 0 6px}
.MathJax_MenuClose:hover {color: white!important; border: 2px solid #CCC!important}
.MathJax_MenuClose:hover span {background-color: #CCC!important}
.MathJax_MenuClose:hover:focus {outline: none}
</style><style type="text/css">.MathJax_Preview .MJXf-math {color: inherit!important}
</style><style type="text/css">.MJX_Assistive_MathML {position: absolute!important; top: 0; left: 0; clip: rect(1px, 1px, 1px, 1px); padding: 1px 0 0 0!important; border: 0!important; height: 1px!important; width: 1px!important; overflow: hidden!important; display: block!important; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none}
.MJX_Assistive_MathML.MJX_Assistive_MathML_Block {width: 100%!important}
</style><style type="text/css">#MathJax_Zoom {position: absolute; background-color: #F0F0F0; overflow: auto; display: block; z-index: 301; padding: .5em; border: 1px solid black; margin: 0; font-weight: normal; font-style: normal; text-align: left; text-indent: 0; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; box-shadow: 5px 5px 15px #AAAAAA; -webkit-box-shadow: 5px 5px 15px #AAAAAA; -moz-box-shadow: 5px 5px 15px #AAAAAA; -khtml-box-shadow: 5px 5px 15px #AAAAAA; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')}
#MathJax_ZoomOverlay {position: absolute; left: 0; top: 0; z-index: 300; display: inline-block; width: 100%; height: 100%; border: 0; padding: 0; margin: 0; background-color: white; opacity: 0; filter: alpha(opacity=0)}
#MathJax_ZoomFrame {position: relative; display: inline-block; height: 0; width: 0}
#MathJax_ZoomEventTrap {position: absolute; left: 0; top: 0; z-index: 302; display: inline-block; border: 0; padding: 0; margin: 0; background-color: white; opacity: 0; filter: alpha(opacity=0)}
</style><style type="text/css">.MathJax_Preview {color: #888}
#MathJax_Message {position: fixed; left: 1px; bottom: 2px; background-color: #E6E6E6; border: 1px solid #959595; margin: 0px; padding: 2px 8px; z-index: 102; color: black; font-size: 80%; width: auto; white-space: nowrap}
#MathJax_MSIE_Frame {position: absolute; top: 0; left: 0; width: 0px; z-index: 101; border: 0px; margin: 0px; padding: 0px}
.MathJax_Error {color: #CC0000; font-style: italic}
</style><style type="text/css">.MJXp-script {font-size: .8em}
.MJXp-right {-webkit-transform-origin: right; -moz-transform-origin: right; -ms-transform-origin: right; -o-transform-origin: right; transform-origin: right}
.MJXp-bold {font-weight: bold}
.MJXp-italic {font-style: italic}
.MJXp-scr {font-family: MathJax_Script,'Times New Roman',Times,STIXGeneral,serif}
.MJXp-frak {font-family: MathJax_Fraktur,'Times New Roman',Times,STIXGeneral,serif}
.MJXp-sf {font-family: MathJax_SansSerif,'Times New Roman',Times,STIXGeneral,serif}
.MJXp-cal {font-family: MathJax_Caligraphic,'Times New Roman',Times,STIXGeneral,serif}
.MJXp-mono {font-family: MathJax_Typewriter,'Times New Roman',Times,STIXGeneral,serif}
.MJXp-largeop {font-size: 150%}
.MJXp-largeop.MJXp-int {vertical-align: -.2em}
.MJXp-math {display: inline-block; line-height: 1.2; text-indent: 0; font-family: 'Times New Roman',Times,STIXGeneral,serif; white-space: nowrap; border-collapse: collapse}
.MJXp-display {display: block; text-align: center; margin: 1em 0}
.MJXp-math span {display: inline-block}
.MJXp-box {display: block!important; text-align: center}
.MJXp-box:after {content: " "}
.MJXp-rule {display: block!important; margin-top: .1em}
.MJXp-char {display: block!important}
.MJXp-mo {margin: 0 .15em}
.MJXp-mfrac {margin: 0 .125em; vertical-align: .25em}
.MJXp-denom {display: inline-table!important; width: 100%}
.MJXp-denom > * {display: table-row!important}
.MJXp-surd {vertical-align: top}
.MJXp-surd > * {display: block!important}
.MJXp-script-box > *  {display: table!important; height: 50%}
.MJXp-script-box > * > * {display: table-cell!important; vertical-align: top}
.MJXp-script-box > *:last-child > * {vertical-align: bottom}
.MJXp-script-box > * > * > * {display: block!important}
.MJXp-mphantom {visibility: hidden}
.MJXp-munderover {display: inline-table!important}
.MJXp-over {display: inline-block!important; text-align: center}
.MJXp-over > * {display: block!important}
.MJXp-munderover > * {display: table-row!important}
.MJXp-mtable {vertical-align: .25em; margin: 0 .125em}
.MJXp-mtable > * {display: inline-table!important; vertical-align: middle}
.MJXp-mtr {display: table-row!important}
.MJXp-mtd {display: table-cell!important; text-align: center; padding: .5em 0 0 .5em}
.MJXp-mtr > .MJXp-mtd:first-child {padding-left: 0}
.MJXp-mtr:first-child > .MJXp-mtd {padding-top: 0}
.MJXp-mlabeledtr {display: table-row!important}
.MJXp-mlabeledtr > .MJXp-mtd:first-child {padding-left: 0}
.MJXp-mlabeledtr:first-child > .MJXp-mtd {padding-top: 0}
.MJXp-merror {background-color: #FFFF88; color: #CC0000; border: 1px solid #CC0000; padding: 1px 3px; font-style: normal; font-size: 90%}
.MJXp-scale0 {-webkit-transform: scaleX(.0); -moz-transform: scaleX(.0); -ms-transform: scaleX(.0); -o-transform: scaleX(.0); transform: scaleX(.0)}
.MJXp-scale1 {-webkit-transform: scaleX(.1); -moz-transform: scaleX(.1); -ms-transform: scaleX(.1); -o-transform: scaleX(.1); transform: scaleX(.1)}
.MJXp-scale2 {-webkit-transform: scaleX(.2); -moz-transform: scaleX(.2); -ms-transform: scaleX(.2); -o-transform: scaleX(.2); transform: scaleX(.2)}
.MJXp-scale3 {-webkit-transform: scaleX(.3); -moz-transform: scaleX(.3); -ms-transform: scaleX(.3); -o-transform: scaleX(.3); transform: scaleX(.3)}
.MJXp-scale4 {-webkit-transform: scaleX(.4); -moz-transform: scaleX(.4); -ms-transform: scaleX(.4); -o-transform: scaleX(.4); transform: scaleX(.4)}
.MJXp-scale5 {-webkit-transform: scaleX(.5); -moz-transform: scaleX(.5); -ms-transform: scaleX(.5); -o-transform: scaleX(.5); transform: scaleX(.5)}
.MJXp-scale6 {-webkit-transform: scaleX(.6); -moz-transform: scaleX(.6); -ms-transform: scaleX(.6); -o-transform: scaleX(.6); transform: scaleX(.6)}
.MJXp-scale7 {-webkit-transform: scaleX(.7); -moz-transform: scaleX(.7); -ms-transform: scaleX(.7); -o-transform: scaleX(.7); transform: scaleX(.7)}
.MJXp-scale8 {-webkit-transform: scaleX(.8); -moz-transform: scaleX(.8); -ms-transform: scaleX(.8); -o-transform: scaleX(.8); transform: scaleX(.8)}
.MJXp-scale9 {-webkit-transform: scaleX(.9); -moz-transform: scaleX(.9); -ms-transform: scaleX(.9); -o-transform: scaleX(.9); transform: scaleX(.9)}
.MathJax_PHTML .noError {vertical-align: ; font-size: 90%; text-align: left; color: black; padding: 1px 3px; border: 1px solid}
</style><style type="text/css">.MathJax_Display {text-align: center; margin: 1em 0em; position: relative; display: block!important; text-indent: 0; max-width: none; max-height: none; min-width: 0; min-height: 0; width: 100%}
.MathJax .merror {background-color: #FFFF88; color: #CC0000; border: 1px solid #CC0000; padding: 1px 3px; font-style: normal; font-size: 90%}
.MathJax .MJX-monospace {font-family: monospace}
.MathJax .MJX-sans-serif {font-family: sans-serif}
#MathJax_Tooltip {background-color: InfoBackground; color: InfoText; border: 1px solid black; box-shadow: 2px 2px 5px #AAAAAA; -webkit-box-shadow: 2px 2px 5px #AAAAAA; -moz-box-shadow: 2px 2px 5px #AAAAAA; -khtml-box-shadow: 2px 2px 5px #AAAAAA; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true'); padding: 3px 4px; z-index: 401; position: absolute; left: 0; top: 0; width: auto; height: auto; display: none}
.MathJax {display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 100%; font-size-adjust: none; text-indent: 0; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0; min-height: 0; border: 0; padding: 0; margin: 0}
.MathJax:focus, body :focus .MathJax {display: inline-table}
.MathJax.MathJax_FullWidth {text-align: center; display: table-cell!important; width: 10000em!important}
.MathJax img, .MathJax nobr, .MathJax a {border: 0; padding: 0; margin: 0; max-width: none; max-height: none; min-width: 0; min-height: 0; vertical-align: 0; line-height: normal; text-decoration: none}
img.MathJax_strut {border: 0!important; padding: 0!important; margin: 0!important; vertical-align: 0!important}
.MathJax span {display: inline; position: static; border: 0; padding: 0; margin: 0; vertical-align: 0; line-height: normal; text-decoration: none}
.MathJax nobr {white-space: nowrap!important}
.MathJax img {display: inline!important; float: none!important}
.MathJax * {transition: none; -webkit-transition: none; -moz-transition: none; -ms-transition: none; -o-transition: none}
.MathJax_Processing {visibility: hidden; position: fixed; width: 0; height: 0; overflow: hidden}
.MathJax_Processed {display: none!important}
.MathJax_ExBox {display: block!important; overflow: hidden; width: 1px; height: 60ex; min-height: 0; max-height: none}
.MathJax .MathJax_EmBox {display: block!important; overflow: hidden; width: 1px; height: 60em; min-height: 0; max-height: none}
.MathJax_LineBox {display: table!important}
.MathJax_LineBox span {display: table-cell!important; width: 10000em!important; min-width: 0; max-width: none; padding: 0; border: 0; margin: 0}
.MathJax .MathJax_HitBox {cursor: text; background: white; opacity: 0; filter: alpha(opacity=0)}
.MathJax .MathJax_HitBox * {filter: none; opacity: 1; background: transparent}
#MathJax_Tooltip * {filter: none; opacity: 1; background: transparent}
@font-face {font-family: MathJax_Blank; src: url('about:blank')}
.MathJax .noError {vertical-align: ; font-size: 90%; text-align: left; color: black; padding: 1px 3px; border: 1px solid}
</style></head>

<body itemscope="" itemtype="http://schema.org/WebPage" class="" style="padding-right: 320px;" lang="en"><div style="visibility: hidden; overflow: hidden; position: absolute; top: 0px; height: 1px; width: auto; padding: 0px; border: 0px none; margin: 0px; text-align: left; text-indent: 0px; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal;"><div id="MathJax_Hidden"></div></div><div id="MathJax_Message" style="display: none;"></div>

  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope="" itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="http://fangs.in/" class="brand" rel="start" style="opacity: 1;">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title" style="opacity: 1; top: 0px;">Cesco: a minimal blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle" style="opacity: 1; top: 0px;"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home" style="opacity: 1; transform: translateY(0px);">
          <a href="http://fangs.in/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about" style="opacity: 1; transform: translateY(0px);">
          <a href="http://fangs.in/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            About
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives" style="opacity: 1; transform: translateY(0px);">
          <a href="http://fangs.in/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            Archives
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags" style="opacity: 1; transform: translateY(0px);">
          <a href="http://fangs.in/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            Tags
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article" style="opacity: 1; display: block; transform: translateY(0px);">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://fangs.in/post/thinkstats/ml_0_linearregression/">

    <span itemprop="author" itemscope="" itemtype="http://schema.org/Person" hidden="">
      <meta itemprop="name" content="Cesc Fangs">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/uploads/avatar.jpg">
    </span>

    <span itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization" hidden="">
      <meta itemprop="name" content="Cesco: a minimal blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">从线性回归说起</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2016-10-02T15:31:00+08:00">
                2016-10-02
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">In</span>
              
              
                <span itemprop="about" itemscope="" itemtype="http://schema.org/Thing">
                  <a href="http://fangs.in/categories/thinkstats/" itemprop="url" rel="index">
                    <span itemprop="name">thinkstats</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="http://fangs.in/post/thinkstats/ml_0_linearregression/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count disqus-comment-count" data-disqus-identifier="post/thinkstats/ml_0_linearregression/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <blockquote>
<p>机器学习要解决的问题，可以分为回归（Regression）和分类（Classification）两种类型，为了解决这些问题，数据科学领域的
专家们研究出了很多算法，线性回归很可能是其中最简单的一种，而工作、生活中许多简单问题往往用不上多么复杂的模型，让我们从最简单的线性回归说起。</p>
</blockquote>
<a id="more"></a>
<h3 id="线性回归快速过一遍">线性回归：快速过一遍</h3>
<p>现在我们有一堆数据 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-1-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1" style="width: 2.567em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.19em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.728em, 1002.14em, 2.93em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-2"><span class="mo" id="MathJax-Span-3" style="font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-4" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mo" id="MathJax-Span-5" style="font-family: STIXGeneral;">,</span><span class="mi" id="MathJax-Span-6" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.188em;">y</span><span class="mo" id="MathJax-Span-7" style="font-family: STIXGeneral;">)</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.304em; border-left: 0px solid; width: 0px; height: 1.157em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mo stretchy="false">(</mo><mi>X</mi><mo>,</mo><mi>y</mi><mo stretchy="false">)</mo></math></span></span><script type="math/tex" id="MathJax-Element-1">(X, y)</script></span> ，<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-2-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-8" style="width: 0.751em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.641em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.751em, 1000.64em, 2.724em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-9"><span class="mi" id="MathJax-Span-10" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.063em; border-left: 0px solid; width: 0px; height: 0.889em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>X</mi></math></span></span><script type="math/tex" id="MathJax-Element-2">X</script></span> 是研究对象的特征，<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-3-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-11" style="width: 0.537em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.427em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.963em, 1000.41em, 2.93em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-12"><span class="mi" id="MathJax-Span-13" style="font-family: STIXGeneral; font-style: italic;">y</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.304em; border-left: 0px solid; width: 0px; height: 0.882em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>y</mi></math></span></span><script type="math/tex" id="MathJax-Element-3">y</script></span> 是想要知道的结果，比如我们想要根据身高（<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-4-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-14" style="width: 0.751em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.641em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.751em, 1000.64em, 2.724em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-15"><span class="mi" id="MathJax-Span-16" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.063em; border-left: 0px solid; width: 0px; height: 0.889em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>X</mi></math></span></span><script type="math/tex" id="MathJax-Element-4">X</script></span>）来预测体重（<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-5-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-17" style="width: 0.537em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.427em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.963em, 1000.41em, 2.93em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-18"><span class="mi" id="MathJax-Span-19" style="font-family: STIXGeneral; font-style: italic;">y</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.304em; border-left: 0px solid; width: 0px; height: 0.882em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>y</mi></math></span></span><script type="math/tex" id="MathJax-Element-5">y</script></span>），假设他们之间有较强的线性关系，那么我们可以用一条直线来拟合这些数据点：</p>
<p><span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-6-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;msub&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-20" style="width: 10.686em; display: inline-block;"><span style="display: inline-block; position: relative; width: 9.135em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.529em, 1009.14em, 2.884em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-21"><span class="msubsup" id="MathJax-Span-22"><span style="display: inline-block; position: relative; width: 0.924em; height: 0px;"><span style="position: absolute; clip: rect(3.163em, 1000.48em, 4.176em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-23" style="font-family: STIXGeneral; font-style: italic;">h</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.5em;"><span class="mi" id="MathJax-Span-24" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-25" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="msubsup" id="MathJax-Span-26" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-27" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mn" id="MathJax-Span-28" style="font-size: 70.7%; font-family: STIXGeneral;">0</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-29" style="font-family: STIXGeneral; padding-left: 0.25em;">+</span><span class="msubsup" id="MathJax-Span-30" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-31" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mn" id="MathJax-Span-32" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-33"><span style="display: inline-block; position: relative; width: 0.873em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-34" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.444em;"><span class="mn" id="MathJax-Span-35" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-36" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="msubsup" id="MathJax-Span-37" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-38" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-39" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-40" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.25em; border-left: 0px solid; width: 0px; height: 1.335em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><msub><mi>h</mi><mi>θ</mi></msub><mo>=</mo><msub><mi>θ</mi><mn>0</mn></msub><mo>+</mo><msub><mi>θ</mi><mn>1</mn></msub><msub><mi>x</mi><mn>1</mn></msub><mo>=</mo><msup><mi>X</mi><mi>T</mi></msup><mi>θ</mi></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-6">
h_\theta=\theta_0+\theta_1x_1=X^T\theta
</script></span></p>
<p>其中 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-7-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-41" style="width: 0.59em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.481em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.726em, 1000.48em, 2.735em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-42"><span class="mi" id="MathJax-Span-43" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.075em; border-left: 0px solid; width: 0px; height: 0.931em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>θ</mi></math></span></span><script type="math/tex" id="MathJax-Element-7">\theta</script></span> 是<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-8-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo&gt;&amp;#x00D7;&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-44" style="width: 2.513em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.137em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.728em, 1002.03em, 2.749em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-45"><span class="mn" id="MathJax-Span-46" style="font-family: STIXGeneral;">2</span><span class="mo" id="MathJax-Span-47" style="font-family: STIXGeneral; padding-left: 0.25em;">×</span><span class="mn" id="MathJax-Span-48" style="font-family: STIXGeneral; padding-left: 0.25em;">1</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.092em; border-left: 0px solid; width: 0px; height: 0.945em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>2</mn><mo>×</mo><mn>1</mn></math></span></span><script type="math/tex" id="MathJax-Element-8">2\times1</script></span> 阶矢量</p>
<p><span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-9-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;[&lt;/mo&gt;&lt;mtable rowspacing=&quot;4pt&quot; columnspacing=&quot;1em&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;mo&gt;]&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-49" style="width: 4.757em; display: inline-block;"><span style="display: inline-block; position: relative; width: 4.06em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(2.526em, 1003.84em, 5.307em, -1000em); top: -4.167em; left: 0em;"><span class="mrow" id="MathJax-Span-50"><span class="mi" id="MathJax-Span-51" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-52" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mrow" id="MathJax-Span-53" style="padding-left: 0.313em;"><span class="mo" id="MathJax-Span-54" style="vertical-align: -0.586em;"><span style="font-family: STIXSizeThreeSym;">[</span></span><span class="mtable" id="MathJax-Span-55" style="padding-right: 0.167em; padding-left: 0.167em;"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(2.493em, 1000.91em, 5.092em, -1000em); top: -4.006em; left: 0em;"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.91em, 4.327em, -1000em); top: -4.681em; left: 50%; margin-left: -0.454em;"><span class="mtd" id="MathJax-Span-56"><span class="mrow" id="MathJax-Span-57"><span class="msubsup" id="MathJax-Span-58"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-59" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mn" id="MathJax-Span-60" style="font-size: 70.7%; font-family: STIXGeneral;">0</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.168em, 1000.91em, 4.317em, -1000em); top: -3.231em; left: 50%; margin-left: -0.454em;"><span class="mtd" id="MathJax-Span-61"><span class="mrow" id="MathJax-Span-62"><span class="msubsup" id="MathJax-Span-63"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-64" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mn" id="MathJax-Span-65" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-66" style="vertical-align: -0.586em;"><span style="font-family: STIXSizeThreeSym;">]</span></span></span></span><span style="display: inline-block; width: 0px; height: 4.167em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -1.209em; border-left: 0px solid; width: 0px; height: 3.003em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mi>θ</mi><mo>=</mo><mrow><mo>[</mo><mtable rowspacing="4pt" columnspacing="1em"><mtr><mtd><msub><mi>θ</mi><mn>0</mn></msub></mtd></mtr><mtr><mtd><msub><mi>θ</mi><mn>1</mn></msub></mtd></mtr></mtable><mo>]</mo></mrow></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-9">
\theta=\left[ 
\begin{matrix}
\theta_0\\  \theta_1
  \end{matrix}\right]
</script></span></p>
<p><span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-10-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-67" style="width: 1.445em; display: inline-block;"><span style="display: inline-block; position: relative; width: 1.229em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.259em, 1001.23em, 2.404em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-68"><span class="msubsup" id="MathJax-Span-69"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-70" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.718em;"><span class="mi" id="MathJax-Span-71" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.063em; border-left: 0px solid; width: 0px; height: 1.09em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msup><mi>X</mi><mi>T</mi></msup></math></span></span><script type="math/tex" id="MathJax-Element-10">X^T</script></span> 表示<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-11-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-72" style="width: 0.751em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.641em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.751em, 1000.64em, 2.724em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-73"><span class="mi" id="MathJax-Span-74" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.063em; border-left: 0px solid; width: 0px; height: 0.889em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>X</mi></math></span></span><script type="math/tex" id="MathJax-Element-11">X</script></span>的转置矩阵（<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-12-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mo&gt;&amp;#x00D7;&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-75" style="width: 2.78em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.35em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.728em, 1002.32em, 2.749em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-76"><span class="mi" id="MathJax-Span-77" style="font-family: STIXGeneral; font-style: italic;">m</span><span class="mo" id="MathJax-Span-78" style="font-family: STIXGeneral; padding-left: 0.25em;">×</span><span class="mn" id="MathJax-Span-79" style="font-family: STIXGeneral; padding-left: 0.25em;">2</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.092em; border-left: 0px solid; width: 0px; height: 0.945em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>m</mi><mo>×</mo><mn>2</mn></math></span></span><script type="math/tex" id="MathJax-Element-12">m\times2</script></span>, <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-13-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-80" style="width: 0.911em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.748em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.963em, 1000.73em, 2.733em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-81"><span class="mi" id="MathJax-Span-82" style="font-family: STIXGeneral; font-style: italic;">m</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.073em; border-left: 0px solid; width: 0px; height: 0.651em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>m</mi></math></span></span><script type="math/tex" id="MathJax-Element-13">m</script></span> 是训练的数据量，<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-14-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msubsup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/msubsup&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-83" style="width: 0.911em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.748em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.131em, 1000.75em, 2.71em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-84"><span class="msubsup" id="MathJax-Span-85"><span style="display: inline-block; position: relative; width: 0.77em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-86" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.385em, 1000.27em, 4.313em, -1000em); top: -4.497em; left: 0.498em;"><span class="mi" id="MathJax-Span-87" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.001em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.384em, 1000.27em, 4.174em, -1000em); top: -3.708em; left: 0.444em;"><span class="mi" id="MathJax-Span-88" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.42em; border-left: 0px solid; width: 0px; height: 1.596em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msubsup><mi>x</mi><mi>i</mi><mi>j</mi></msubsup></math></span></span><script type="math/tex" id="MathJax-Element-14">x_i^j</script></span> 表示的是第 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-15-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-89" style="width: 0.323em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.267em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.752em, 1000.27em, 2.931em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-90"><span class="mi" id="MathJax-Span-91" style="font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.001em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.305em; border-left: 0px solid; width: 0px; height: 1.13em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>j</mi></math></span></span><script type="math/tex" id="MathJax-Element-15">j</script></span> 个数据的第 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-16-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-92" style="width: 0.323em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.267em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.75em, 1000.25em, 2.735em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-93"><span class="mi" id="MathJax-Span-94" style="font-family: STIXGeneral; font-style: italic;">i</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.075em; border-left: 0px solid; width: 0px; height: 0.903em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>i</mi></math></span></span><script type="math/tex" id="MathJax-Element-16">i</script></span> 个特征），其中<span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-17-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-95" style="width: 1.445em; display: inline-block;"><span style="display: inline-block; position: relative; width: 1.229em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.209em, 1001.23em, 2.404em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-96"><span class="msubsup" id="MathJax-Span-97"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-98" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-99" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.063em; border-left: 0px solid; width: 0px; height: 1.148em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><msup><mi>X</mi><mi>T</mi></msup></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-17">X^T</script></span> 第一列的所有数据都是1（因为 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-18-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-100" style="width: 1.071em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.908em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.405em, 1000.91em, 2.564em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-101"><span class="msubsup" id="MathJax-Span-102"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-103" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mn" id="MathJax-Span-104" style="font-size: 70.7%; font-family: STIXGeneral;">0</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.25em; border-left: 0px solid; width: 0px; height: 1.105em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>θ</mi><mn>0</mn></msub></math></span></span><script type="math/tex" id="MathJax-Element-18">\theta_0</script></span> 的系数是1）:</p>
<p><span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-19-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;[&lt;/mo&gt;&lt;mtable rowspacing=&quot;4pt&quot; columnspacing=&quot;1em&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msubsup&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msubsup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msubsup&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msubsup&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msubsup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msubsup&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mo&gt;.&lt;/mo&gt;&lt;mo&gt;.&lt;/mo&gt;&lt;mo&gt;.&lt;/mo&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/msubsup&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msubsup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/msubsup&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;mo&gt;]&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-105" style="width: 7.535em; display: inline-block;"><span style="display: inline-block; position: relative; width: 6.41em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(2.369em, 1006.36em, 8.455em, -1000em); top: -5.662em; left: 0em;"><span class="mrow" id="MathJax-Span-106"><span class="msubsup" id="MathJax-Span-107"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-108" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-109" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-110" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mrow" id="MathJax-Span-111" style="padding-left: 0.313em;"><span class="mo" id="MathJax-Span-112" style="vertical-align: 3.133em;"><span style="display: inline-block; position: relative; width: 0.45em; height: 0px;"><span style="position: absolute; font-family: STIXSizeOneSym; top: -3.324em; left: 0em;">⎡<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; font-family: STIXSizeOneSym; top: 1.441em; left: 0em;">⎣<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: -2.371em; left: 0em;">⎢<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: -1.418em; left: 0em;">⎢<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: -0.465em; left: 0em;">⎢<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: 0.488em; left: 0em;">⎢<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mtable" id="MathJax-Span-113" style="padding-right: 0.167em; padding-left: 0.167em;"><span style="display: inline-block; position: relative; width: 2.605em; height: 0px;"><span style="position: absolute; clip: rect(3.491em, 1002.61em, 9.577em, -1000em); top: -6.784em; left: 0em;"><span style="display: inline-block; position: relative; width: 2.605em; height: 0px;"><span style="position: absolute; clip: rect(3.024em, 1002.29em, 4.49em, -1000em); top: -6.317em; left: 50%; margin-left: -1.145em;"><span class="mtd" id="MathJax-Span-114"><span class="mrow" id="MathJax-Span-115"><span class="msubsup" id="MathJax-Span-116"><span style="display: inline-block; position: relative; width: 0.926em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-117" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -4.351em; left: 0.498em;"><span class="mn" id="MathJax-Span-118" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.177em, -1000em); top: -3.693em; left: 0.444em;"><span class="mn" id="MathJax-Span-119" style="font-size: 70.7%; font-family: STIXGeneral;">0</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-120" style="font-family: STIXGeneral;">,</span><span class="msubsup" id="MathJax-Span-121" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 0.926em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-122" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -4.351em; left: 0.498em;"><span class="mn" id="MathJax-Span-123" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -3.693em; left: 0.444em;"><span class="mn" id="MathJax-Span-124" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.024em, 1002.29em, 4.49em, -1000em); top: -4.721em; left: 50%; margin-left: -1.145em;"><span class="mtd" id="MathJax-Span-125"><span class="mrow" id="MathJax-Span-126"><span class="msubsup" id="MathJax-Span-127"><span style="display: inline-block; position: relative; width: 0.926em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-128" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -4.351em; left: 0.498em;"><span class="mn" id="MathJax-Span-129" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.177em, -1000em); top: -3.693em; left: 0.444em;"><span class="mn" id="MathJax-Span-130" style="font-size: 70.7%; font-family: STIXGeneral;">0</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-131" style="font-family: STIXGeneral;">,</span><span class="msubsup" id="MathJax-Span-132" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 0.926em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-133" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -4.351em; left: 0.498em;"><span class="mn" id="MathJax-Span-134" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -3.693em; left: 0.444em;"><span class="mn" id="MathJax-Span-135" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.746em, 1001.06em, 4.178em, -1000em); top: -3.147em; left: 50%; margin-left: -0.563em;"><span class="mtd" id="MathJax-Span-136"><span class="mrow" id="MathJax-Span-137"><span class="mo" id="MathJax-Span-138" style="font-family: STIXGeneral;">.</span><span class="mo" id="MathJax-Span-139" style="font-family: STIXGeneral; padding-left: 0.188em;">.</span><span class="mo" id="MathJax-Span-140" style="font-family: STIXGeneral; padding-left: 0.188em;">.</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.184em, 1002.61em, 4.49em, -1000em); top: -1.697em; left: 50%; margin-left: -1.302em;"><span class="mtd" id="MathJax-Span-141"><span class="mrow" id="MathJax-Span-142"><span class="msubsup" id="MathJax-Span-143"><span style="display: inline-block; position: relative; width: 1.083em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-144" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.534em, 1000.59em, 4.173em, -1000em); top: -4.357em; left: 0.498em;"><span class="mi" id="MathJax-Span-145" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.177em, -1000em); top: -3.693em; left: 0.444em;"><span class="mn" id="MathJax-Span-146" style="font-size: 70.7%; font-family: STIXGeneral;">0</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-147" style="font-family: STIXGeneral;">,</span><span class="msubsup" id="MathJax-Span-148" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 1.083em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-149" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.534em, 1000.59em, 4.173em, -1000em); top: -4.357em; left: 0.498em;"><span class="mi" id="MathJax-Span-150" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -3.693em; left: 0.444em;"><span class="mn" id="MathJax-Span-151" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 6.784em;"></span></span></span></span><span class="mo" id="MathJax-Span-152" style="vertical-align: 3.133em;"><span style="display: inline-block; position: relative; width: 0.45em; height: 0px;"><span style="position: absolute; font-family: STIXSizeOneSym; top: -3.324em; left: 0em;">⎤<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; font-family: STIXSizeOneSym; top: 1.441em; left: 0em;">⎦<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: -2.371em; left: 0em;">⎥<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: -1.418em; left: 0em;">⎥<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: -0.465em; left: 0em;">⎥<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: 0.488em; left: 0em;">⎥<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 5.662em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -3.143em; border-left: 0px solid; width: 0px; height: 6.87em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><msup><mi>X</mi><mi>T</mi></msup><mo>=</mo><mrow><mo>[</mo><mtable rowspacing="4pt" columnspacing="1em"><mtr><mtd><msubsup><mi>x</mi><mn>0</mn><mn>1</mn></msubsup><mo>,</mo><msubsup><mi>x</mi><mn>1</mn><mn>1</mn></msubsup></mtd></mtr><mtr><mtd><msubsup><mi>x</mi><mn>0</mn><mn>2</mn></msubsup><mo>,</mo><msubsup><mi>x</mi><mn>1</mn><mn>2</mn></msubsup></mtd></mtr><mtr><mtd><mo>.</mo><mo>.</mo><mo>.</mo></mtd></mtr><mtr><mtd><msubsup><mi>x</mi><mn>0</mn><mi>m</mi></msubsup><mo>,</mo><msubsup><mi>x</mi><mn>1</mn><mi>m</mi></msubsup></mtd></mtr></mtable><mo>]</mo></mrow></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-19">
X^T=\left[\begin{matrix}
x_0^1, x_1^1\\
x_0^2, x_1^2\\
...\\
x_0^m, x_1^m\\
\end{matrix}\right]
</script></span></p>
<p>在已知 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-20-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-153" style="width: 0.59em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.481em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.726em, 1000.48em, 2.735em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-154"><span class="mi" id="MathJax-Span-155" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.075em; border-left: 0px solid; width: 0px; height: 0.931em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>θ</mi></math></span></span><script type="math/tex" id="MathJax-Element-20">\theta</script></span> 时，我们可以根据下式预测某个数据 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-21-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-156" style="width: 1.445em; display: inline-block;"><span style="display: inline-block; position: relative; width: 1.229em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.242em, 1001.23em, 2.415em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-157"><span class="msubsup" id="MathJax-Span-158"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-159" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.498em;"><span class="texatom" id="MathJax-Span-160"><span class="mrow" id="MathJax-Span-161"><span class="mo" id="MathJax-Span-162" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-163" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-164" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.075em; border-left: 0px solid; width: 0px; height: 1.122em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup></math></span></span><script type="math/tex" id="MathJax-Element-21">x^{(i)}</script></span> 对应的 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-22-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-165" style="width: 1.392em; display: inline-block;"><span style="display: inline-block; position: relative; width: 1.175em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.242em, 1001.18em, 2.61em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-166"><span class="msubsup" id="MathJax-Span-167"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-168" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.444em;"><span class="texatom" id="MathJax-Span-169"><span class="mrow" id="MathJax-Span-170"><span class="mo" id="MathJax-Span-171" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-172" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-173" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.304em; border-left: 0px solid; width: 0px; height: 1.35em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup></math></span></span><script type="math/tex" id="MathJax-Element-22">y^{(i)}</script></span>：</p>
<p><span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-23-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;msubsup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msubsup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-174" style="width: 16.936em; display: inline-block;"><span style="display: inline-block; position: relative; width: 14.476em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.456em, 1014.48em, 3.038em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-175"><span class="msubsup" id="MathJax-Span-176"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-177" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.444em;"><span class="texatom" id="MathJax-Span-178"><span class="mrow" id="MathJax-Span-179"><span class="mo" id="MathJax-Span-180" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-181" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-182" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-183" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="msubsup" id="MathJax-Span-184" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 0.924em; height: 0px;"><span style="position: absolute; clip: rect(3.163em, 1000.48em, 4.176em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-185" style="font-family: STIXGeneral; font-style: italic;">h</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.5em;"><span class="mi" id="MathJax-Span-186" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-187" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-188"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-189" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.498em;"><span class="texatom" id="MathJax-Span-190"><span class="mrow" id="MathJax-Span-191"><span class="mo" id="MathJax-Span-192" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-193" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-194" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-195" style="font-family: STIXGeneral;">)</span><span class="mo" id="MathJax-Span-196" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="msubsup" id="MathJax-Span-197" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-198" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mn" id="MathJax-Span-199" style="font-size: 70.7%; font-family: STIXGeneral;">0</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-200" style="font-family: STIXGeneral; padding-left: 0.25em;">+</span><span class="msubsup" id="MathJax-Span-201" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-202" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mn" id="MathJax-Span-203" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-204"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-205" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.74em, 4.292em, -1000em); top: -4.476em; left: 0.498em;"><span class="texatom" id="MathJax-Span-206"><span class="mrow" id="MathJax-Span-207"><span class="mo" id="MathJax-Span-208" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-209" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-210" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -3.693em; left: 0.444em;"><span class="mn" id="MathJax-Span-211" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-212" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="msubsup" id="MathJax-Span-213" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 1.071em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-214" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.548em;"><span class="mi" id="MathJax-Span-215" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-216"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-217" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.498em;"><span class="texatom" id="MathJax-Span-218"><span class="mrow" id="MathJax-Span-219"><span class="mo" id="MathJax-Span-220" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-221" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-222" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.429em; border-left: 0px solid; width: 0px; height: 1.601em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>=</mo><msub><mi>h</mi><mi>θ</mi></msub><mo stretchy="false">(</mo><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo stretchy="false">)</mo><mo>=</mo><msub><mi>θ</mi><mn>0</mn></msub><mo>+</mo><msub><mi>θ</mi><mn>1</mn></msub><msubsup><mi>x</mi><mn>1</mn><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msubsup><mo>=</mo><msup><mi>θ</mi><mi>T</mi></msup><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-23">
y^{(i)}=h_\theta(x^{(i)})=\theta_0+\theta_1x_1^{(i)}=\theta^Tx^{(i)}
</script></span></p>
<p>既然是拟合的直线，其结果和实际的数据就会存在偏差，我们用损失函数（Cost Function）来表示预测值（<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-24-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msub&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-223" style="width: 1.071em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.908em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.4em, 1000.91em, 2.562em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-224"><span class="msubsup" id="MathJax-Span-225"><span style="display: inline-block; position: relative; width: 0.924em; height: 0px;"><span style="position: absolute; clip: rect(3.163em, 1000.48em, 4.176em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-226" style="font-family: STIXGeneral; font-style: italic;">h</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.5em;"><span class="mi" id="MathJax-Span-227" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.247em; border-left: 0px solid; width: 0px; height: 1.109em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>h</mi><mi>θ</mi></msub></math></span></span><script type="math/tex" id="MathJax-Element-24">h_\theta</script></span>）与实际值（<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-25-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-228" style="width: 0.537em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.427em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.963em, 1000.41em, 2.93em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-229"><span class="mi" id="MathJax-Span-230" style="font-family: STIXGeneral; font-style: italic;">y</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.304em; border-left: 0px solid; width: 0px; height: 0.882em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>y</mi></math></span></span><script type="math/tex" id="MathJax-Element-25">y</script></span>）的偏离程度：</p>
<p><span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-26-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mi&gt;J&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;munderover&gt;&lt;mo&gt;&amp;#x2211;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-231" style="width: 14.479em; display: inline-block;"><span style="display: inline-block; position: relative; width: 12.34em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(0.792em, 1012.34em, 3.982em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-232"><span class="mi" id="MathJax-Span-233" style="font-family: STIXGeneral; font-style: italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.047em;"></span></span><span class="mo" id="MathJax-Span-234" style="font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-235" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-236" style="font-family: STIXGeneral;">)</span><span class="mo" id="MathJax-Span-237" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mfrac" id="MathJax-Span-238" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 1.342em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.17em, 1000.39em, 4.167em, -1000em); top: -4.683em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-239" style="font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.17em, 1001.2em, 4.176em, -1000em); top: -3.32em; left: 50%; margin-left: -0.611em;"><span class="mrow" id="MathJax-Span-240"><span class="mn" id="MathJax-Span-241" style="font-family: STIXGeneral;">2</span><span class="mi" id="MathJax-Span-242" style="font-family: STIXGeneral; font-style: italic;">m</span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1001.34em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 1.342em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="munderover" id="MathJax-Span-243" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 1.292em; height: 0px;"><span style="position: absolute; clip: rect(2.871em, 1001.2em, 4.642em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-244" style="font-family: STIXSizeOneSym; vertical-align: -0.524em;">∑</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.96em, 4.274em, -1000em); top: -2.856em; left: 0.129em;"><span class="texatom" id="MathJax-Span-245"><span class="mrow" id="MathJax-Span-246"><span class="mi" id="MathJax-Span-247" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-248" style="font-size: 70.7%; font-family: STIXGeneral;">=</span><span class="mn" id="MathJax-Span-249" style="font-size: 70.7%; font-family: STIXGeneral;">1</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.434em, 1000.5em, 4.173em, -1000em); top: -5.206em; left: 0.391em;"><span class="texatom" id="MathJax-Span-250"><span class="mrow" id="MathJax-Span-251"><span class="mi" id="MathJax-Span-252" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-253" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-254"><span style="display: inline-block; position: relative; width: 0.924em; height: 0px;"><span style="position: absolute; clip: rect(3.163em, 1000.48em, 4.176em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-255" style="font-family: STIXGeneral; font-style: italic;">h</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.5em;"><span class="mi" id="MathJax-Span-256" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-257" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-258"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-259" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.498em;"><span class="texatom" id="MathJax-Span-260"><span class="mrow" id="MathJax-Span-261"><span class="mo" id="MathJax-Span-262" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-263" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-264" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-265" style="font-family: STIXGeneral;">)</span><span class="mo" id="MathJax-Span-266" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-267" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-268" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.444em;"><span class="texatom" id="MathJax-Span-269"><span class="mrow" id="MathJax-Span-270"><span class="mo" id="MathJax-Span-271" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-272" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-273" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-274"><span style="display: inline-block; position: relative; width: 0.762em; height: 0px;"><span style="position: absolute; clip: rect(3.17em, 1000.29em, 4.344em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-275" style="font-family: STIXGeneral;">)</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.333em;"><span class="mn" id="MathJax-Span-276" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -1.534em; border-left: 0px solid; width: 0px; height: 3.482em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mi>J</mi><mo stretchy="false">(</mo><mi>θ</mi><mo stretchy="false">)</mo><mo>=</mo><mfrac><mn>1</mn><mrow><mn>2</mn><mi>m</mi></mrow></mfrac><munderover><mo>∑</mo><mrow class="MJX-TeXAtom-ORD"><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow class="MJX-TeXAtom-ORD"><mi>m</mi></mrow></munderover><mo stretchy="false">(</mo><msub><mi>h</mi><mi>θ</mi></msub><mo stretchy="false">(</mo><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo stretchy="false">)</mo><mo>−</mo><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><msup><mo stretchy="false">)</mo><mn>2</mn></msup></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-26">
J(\theta)=\frac{1}{2m}\sum_{i=1}^{m} (h_\theta(x^{(i)})-y^{(i)})^2
</script></span></p>
<p>你可能会感到奇怪，为什么分母是 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-27-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-277" style="width: 1.445em; display: inline-block;"><span style="display: inline-block; position: relative; width: 1.229em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.728em, 1001.21em, 2.733em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-278"><span class="mn" id="MathJax-Span-279" style="font-family: STIXGeneral;">2</span><span class="mi" id="MathJax-Span-280" style="font-family: STIXGeneral; font-style: italic;">m</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.073em; border-left: 0px solid; width: 0px; height: 0.926em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>2</mn><mi>m</mi></math></span></span><script type="math/tex" id="MathJax-Element-27">2m</script></span> 而不是 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-28-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-281" style="width: 0.911em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.748em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.963em, 1000.73em, 2.733em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-282"><span class="mi" id="MathJax-Span-283" style="font-family: STIXGeneral; font-style: italic;">m</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.073em; border-left: 0px solid; width: 0px; height: 0.651em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>m</mi></math></span></span><script type="math/tex" id="MathJax-Element-28">m</script></span> ? 这并没什么特别的理由，只是在求损失函数的偏微分时可以和指数2结合，使最后的结果更加简洁（往下看就知道了，理论上分母是 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-29-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;20&lt;/mn&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-284" style="width: 5.345em; display: inline-block;"><span style="display: inline-block; position: relative; width: 4.541em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.728em, 1004.52em, 2.865em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-285"><span class="mi" id="MathJax-Span-286" style="font-family: STIXGeneral; font-style: italic;">m</span><span class="mo" id="MathJax-Span-287" style="font-family: STIXGeneral;">,</span><span class="mn" id="MathJax-Span-288" style="font-family: STIXGeneral; padding-left: 0.188em;">2</span><span class="mi" id="MathJax-Span-289" style="font-family: STIXGeneral; font-style: italic;">m</span><span class="mo" id="MathJax-Span-290" style="font-family: STIXGeneral;">,</span><span class="mn" id="MathJax-Span-291" style="font-family: STIXGeneral; padding-left: 0.188em;">20</span><span class="mi" id="MathJax-Span-292" style="font-family: STIXGeneral; font-style: italic;">m</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.227em; border-left: 0px solid; width: 0px; height: 1.081em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>m</mi><mo>,</mo><mn>2</mn><mi>m</mi><mo>,</mo><mn>20</mn><mi>m</mi></math></span></span><script type="math/tex" id="MathJax-Element-29">m, 2m, 20m</script></span> 都可以）。</p>
<p>为了使预测值尽可能接近实际值，我们要让 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-30-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;J&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-293" style="width: 1.979em; display: inline-block;"><span style="display: inline-block; position: relative; width: 1.656em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.726em, 1001.61em, 2.901em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-294"><span class="mi" id="MathJax-Span-295" style="font-family: STIXGeneral; font-style: italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.047em;"></span></span><span class="mo" id="MathJax-Span-296" style="font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-297" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-298" style="font-family: STIXGeneral;">)</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.27em; border-left: 0px solid; width: 0px; height: 1.125em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>J</mi><mo stretchy="false">(</mo><mi>θ</mi><mo stretchy="false">)</mo></math></span></span><script type="math/tex" id="MathJax-Element-30">J(\theta)</script></span> 达到最小值，数学上可以证明如果 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-31-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;J&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-299" style="width: 1.979em; display: inline-block;"><span style="display: inline-block; position: relative; width: 1.656em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.726em, 1001.61em, 2.901em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-300"><span class="mi" id="MathJax-Span-301" style="font-family: STIXGeneral; font-style: italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.047em;"></span></span><span class="mo" id="MathJax-Span-302" style="font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-303" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-304" style="font-family: STIXGeneral;">)</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.27em; border-left: 0px solid; width: 0px; height: 1.125em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>J</mi><mo stretchy="false">(</mo><mi>θ</mi><mo stretchy="false">)</mo></math></span></span><script type="math/tex" id="MathJax-Element-31">J(\theta)</script></span> 存在极值，那么一定在<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-32-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2202;&lt;/mi&gt;&lt;mi&gt;J&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2202;&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-305" style="width: 4.33em; display: inline-block;"><span style="display: inline-block; position: relative; width: 3.686em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.389em, 1003.66em, 3.122em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-306"><span class="mfrac" id="MathJax-Span-307"><span style="display: inline-block; position: relative; width: 1.62em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.367em, 1001.47em, 4.292em, -1000em); top: -4.542em; left: 50%; margin-left: -0.75em;"><span class="mrow" id="MathJax-Span-308"><span class="mi" id="MathJax-Span-309" style="font-size: 70.7%; font-family: STIXGeneral;">∂</span><span class="mi" id="MathJax-Span-310" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.033em;"></span></span><span class="mo" id="MathJax-Span-311" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-312" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span class="mo" id="MathJax-Span-313" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.367em, 1000.68em, 4.174em, -1000em); top: -3.617em; left: 50%; margin-left: -0.341em;"><span class="mrow" id="MathJax-Span-314"><span class="mi" id="MathJax-Span-315" style="font-size: 70.7%; font-family: STIXGeneral;">∂</span><span class="mi" id="MathJax-Span-316" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1001.62em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 1.62em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="mo" id="MathJax-Span-317" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mn" id="MathJax-Span-318" style="font-family: STIXGeneral; padding-left: 0.313em;">0</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.527em; border-left: 0px solid; width: 0px; height: 1.777em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>J</mi><mo stretchy="false">(</mo><mi>θ</mi><mo stretchy="false">)</mo></mrow><mrow><mi mathvariant="normal">∂</mi><mi>θ</mi></mrow></mfrac><mo>=</mo><mn>0</mn></math></span></span><script type="math/tex" id="MathJax-Element-32">\frac{\partial J(\theta)}{\partial \theta}=0</script></span> 时得到，<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-33-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2202;&lt;/mi&gt;&lt;mi&gt;J&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2202;&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-319" style="width: 2.193em; display: inline-block;"><span style="display: inline-block; position: relative; width: 1.87em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.069em, 1001.87em, 2.801em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-320"><span class="mfrac" id="MathJax-Span-321"><span style="display: inline-block; position: relative; width: 1.62em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.367em, 1001.47em, 4.292em, -1000em); top: -4.542em; left: 50%; margin-left: -0.75em;"><span class="mrow" id="MathJax-Span-322"><span class="mi" id="MathJax-Span-323" style="font-size: 70.7%; font-family: STIXGeneral;">∂</span><span class="mi" id="MathJax-Span-324" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.033em;"></span></span><span class="mo" id="MathJax-Span-325" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-326" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span class="mo" id="MathJax-Span-327" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.367em, 1000.68em, 4.174em, -1000em); top: -3.617em; left: 50%; margin-left: -0.341em;"><span class="mrow" id="MathJax-Span-328"><span class="mi" id="MathJax-Span-329" style="font-size: 70.7%; font-family: STIXGeneral;">∂</span><span class="mi" id="MathJax-Span-330" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1001.62em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 1.62em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.527em; border-left: 0px solid; width: 0px; height: 1.777em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>J</mi><mo stretchy="false">(</mo><mi>θ</mi><mo stretchy="false">)</mo></mrow><mrow><mi mathvariant="normal">∂</mi><mi>θ</mi></mrow></mfrac></math></span></span><script type="math/tex" id="MathJax-Element-33">\frac{\partial J(\theta)}{\partial \theta}</script></span> 其实就是 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-34-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;J&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-331" style="width: 1.979em; display: inline-block;"><span style="display: inline-block; position: relative; width: 1.656em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.726em, 1001.61em, 2.901em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-332"><span class="mi" id="MathJax-Span-333" style="font-family: STIXGeneral; font-style: italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.047em;"></span></span><span class="mo" id="MathJax-Span-334" style="font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-335" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-336" style="font-family: STIXGeneral;">)</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.27em; border-left: 0px solid; width: 0px; height: 1.125em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>J</mi><mo stretchy="false">(</mo><mi>θ</mi><mo stretchy="false">)</mo></math></span></span><script type="math/tex" id="MathJax-Element-34">J(\theta)</script></span> 函数的梯度，或者更通俗一点，斜率。在机器学习里，使用梯度下降算法更新参数 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-35-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-337" style="width: 0.59em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.481em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.726em, 1000.48em, 2.735em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-338"><span class="mi" id="MathJax-Span-339" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.075em; border-left: 0px solid; width: 0px; height: 0.931em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>θ</mi></math></span></span><script type="math/tex" id="MathJax-Element-35">\theta</script></span> 是很常见的：</p>
<p><span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-36-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mi&gt;&amp;#x03B1;&lt;/mi&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2202;&lt;/mi&gt;&lt;mi&gt;J&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2202;&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mfrac&gt;&lt;mi&gt;&amp;#x03B1;&lt;/mi&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mfrac&gt;&lt;munderover&gt;&lt;mo&gt;&amp;#x2211;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-340" style="width: 21.691em; display: inline-block;"><span style="display: inline-block; position: relative; width: 18.536em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(0.792em, 1018.54em, 3.982em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-341"><span class="msubsup" id="MathJax-Span-342"><span style="display: inline-block; position: relative; width: 0.752em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-343" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mi" id="MathJax-Span-344" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.001em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-345" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="msubsup" id="MathJax-Span-346" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 0.752em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-347" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mi" id="MathJax-Span-348" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.001em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-349" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="mi" id="MathJax-Span-350" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.25em;">α</span><span class="mfrac" id="MathJax-Span-351"><span style="display: inline-block; position: relative; width: 1.343em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.178em, 1000.96em, 4.185em, -1000em); top: -4.683em; left: 50%; margin-left: -0.481em;"><span class="mrow" id="MathJax-Span-352"><span class="mi" id="MathJax-Span-353" style="font-family: STIXGeneral;">∂</span><span class="mi" id="MathJax-Span-354" style="font-family: STIXGeneral; font-style: italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.047em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.168em, 1001.22em, 4.463em, -1000em); top: -3.32em; left: 50%; margin-left: -0.612em;"><span class="mrow" id="MathJax-Span-355"><span class="mi" id="MathJax-Span-356" style="font-family: STIXGeneral;">∂</span><span class="msubsup" id="MathJax-Span-357"><span style="display: inline-block; position: relative; width: 0.752em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-358" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mi" id="MathJax-Span-359" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.001em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1001.34em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 1.343em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="mo" id="MathJax-Span-360" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="msubsup" id="MathJax-Span-361" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 0.752em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-362" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mi" id="MathJax-Span-363" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.001em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-364" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="mfrac" id="MathJax-Span-365" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 0.842em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.405em, 1000.55em, 4.178em, -1000em); top: -4.683em; left: 50%; margin-left: -0.276em;"><span class="mi" id="MathJax-Span-366" style="font-family: STIXGeneral; font-style: italic;">α</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.405em, 1000.7em, 4.176em, -1000em); top: -3.32em; left: 50%; margin-left: -0.361em;"><span class="mi" id="MathJax-Span-367" style="font-family: STIXGeneral; font-style: italic;">m</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1000.84em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 0.842em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="munderover" id="MathJax-Span-368" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 1.292em; height: 0px;"><span style="position: absolute; clip: rect(2.871em, 1001.2em, 4.642em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-369" style="font-family: STIXSizeOneSym; vertical-align: -0.524em;">∑</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.96em, 4.274em, -1000em); top: -2.856em; left: 0.129em;"><span class="texatom" id="MathJax-Span-370"><span class="mrow" id="MathJax-Span-371"><span class="mi" id="MathJax-Span-372" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-373" style="font-size: 70.7%; font-family: STIXGeneral;">=</span><span class="mn" id="MathJax-Span-374" style="font-size: 70.7%; font-family: STIXGeneral;">1</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.434em, 1000.5em, 4.173em, -1000em); top: -5.206em; left: 0.391em;"><span class="texatom" id="MathJax-Span-375"><span class="mrow" id="MathJax-Span-376"><span class="mi" id="MathJax-Span-377" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-378" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-379"><span style="display: inline-block; position: relative; width: 0.924em; height: 0px;"><span style="position: absolute; clip: rect(3.163em, 1000.48em, 4.176em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-380" style="font-family: STIXGeneral; font-style: italic;">h</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.5em;"><span class="mi" id="MathJax-Span-381" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-382" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-383"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-384" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.498em;"><span class="texatom" id="MathJax-Span-385"><span class="mrow" id="MathJax-Span-386"><span class="mo" id="MathJax-Span-387" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-388" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-389" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-390" style="font-family: STIXGeneral;">)</span><span class="mo" id="MathJax-Span-391" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-392" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-393" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.444em;"><span class="texatom" id="MathJax-Span-394"><span class="mrow" id="MathJax-Span-395"><span class="mo" id="MathJax-Span-396" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-397" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-398" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-399" style="font-family: STIXGeneral;">)</span><span class="msubsup" id="MathJax-Span-400"><span style="display: inline-block; position: relative; width: 0.716em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-401" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.444em;"><span class="mi" id="MathJax-Span-402" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.001em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -1.534em; border-left: 0px solid; width: 0px; height: 3.482em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><msub><mi>θ</mi><mi>j</mi></msub><mo>=</mo><msub><mi>θ</mi><mi>j</mi></msub><mo>−</mo><mi>α</mi><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>J</mi></mrow><mrow><mi mathvariant="normal">∂</mi><msub><mi>θ</mi><mi>j</mi></msub></mrow></mfrac><mo>=</mo><msub><mi>θ</mi><mi>j</mi></msub><mo>−</mo><mfrac><mi>α</mi><mi>m</mi></mfrac><munderover><mo>∑</mo><mrow class="MJX-TeXAtom-ORD"><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow class="MJX-TeXAtom-ORD"><mi>m</mi></mrow></munderover><mo stretchy="false">(</mo><msub><mi>h</mi><mi>θ</mi></msub><mo stretchy="false">(</mo><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo stretchy="false">)</mo><mo>−</mo><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo stretchy="false">)</mo><msub><mi>x</mi><mi>j</mi></msub></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-36">
\theta_j = \theta_j-\alpha\frac{\partial J}{\partial \theta_j}=\theta_j-\frac{\alpha}{m}\sum_{i=1}^{m}(h_\theta(x^{(i)})-y^{(i)})x_j
</script></span></p>
<p>上式的 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-37-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;&amp;#x03B1;&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-403" style="width: 0.644em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.534em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.963em, 1000.53em, 2.735em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-404"><span class="mi" id="MathJax-Span-405" style="font-family: STIXGeneral; font-style: italic;">α</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.075em; border-left: 0px solid; width: 0px; height: 0.654em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>α</mi></math></span></span><script type="math/tex" id="MathJax-Element-37">\alpha</script></span> 取正值，给定了下降的速度，你也可以理解为机器学习的速度，显然 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-38-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;&amp;#x03B1;&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-406" style="width: 0.644em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.534em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.963em, 1000.53em, 2.735em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-407"><span class="mi" id="MathJax-Span-408" style="font-family: STIXGeneral; font-style: italic;">α</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.075em; border-left: 0px solid; width: 0px; height: 0.654em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>α</mi></math></span></span><script type="math/tex" id="MathJax-Element-38">\alpha</script></span> 越大，梯度下降的越快，但这通常并不是一件好事，过大的下降速度往往会导致迭代算法直接略过最优点从而无法收敛。如果你不断用合理的 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-39-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;&amp;#x03B1;&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-409" style="width: 0.644em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.534em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.963em, 1000.53em, 2.735em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-410"><span class="mi" id="MathJax-Span-411" style="font-family: STIXGeneral; font-style: italic;">α</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.075em; border-left: 0px solid; width: 0px; height: 0.654em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>α</mi></math></span></span><script type="math/tex" id="MathJax-Element-39">\alpha</script></span> 上式进行迭代，损失函数的值最后会无限接近于极值点。</p>
<p>我们当然可以用一个循环遍历 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-40-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;:&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-412" style="width: 2.513em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.137em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.405em, 1002.14em, 2.7em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-413"><span class="msubsup" id="MathJax-Span-414"><span style="display: inline-block; position: relative; width: 2.14em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-415" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="texatom" id="MathJax-Span-416"><span class="mrow" id="MathJax-Span-417"><span class="mi" id="MathJax-Span-418" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.001em;"></span></span><span class="mo" id="MathJax-Span-419" style="font-size: 70.7%; font-family: STIXGeneral;">=</span><span class="mn" id="MathJax-Span-420" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span class="mo" id="MathJax-Span-421" style="font-size: 70.7%; font-family: STIXGeneral;">:</span><span class="mi" id="MathJax-Span-422" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">n</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.409em; border-left: 0px solid; width: 0px; height: 1.265em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>θ</mi><mrow class="MJX-TeXAtom-ORD"><mi>j</mi><mo>=</mo><mn>1</mn><mo>:</mo><mi>n</mi></mrow></msub></math></span></span><script type="math/tex" id="MathJax-Element-40">\theta_{j=1:n}</script></span> （本例中 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-41-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-423" style="width: 2.727em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.297em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.728em, 1002.27em, 2.733em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-424"><span class="mi" id="MathJax-Span-425" style="font-family: STIXGeneral; font-style: italic;">n</span><span class="mo" id="MathJax-Span-426" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mn" id="MathJax-Span-427" style="font-family: STIXGeneral; padding-left: 0.313em;">2</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.073em; border-left: 0px solid; width: 0px; height: 0.926em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi><mo>=</mo><mn>2</mn></math></span></span><script type="math/tex" id="MathJax-Element-41">n=2</script></span> ），当 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-42-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-428" style="width: 0.59em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.481em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.963em, 1000.46em, 2.733em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-429"><span class="mi" id="MathJax-Span-430" style="font-family: STIXGeneral; font-style: italic;">n</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.073em; border-left: 0px solid; width: 0px; height: 0.651em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi></math></span></span><script type="math/tex" id="MathJax-Element-42">n</script></span> 很大时，使用循环来遍历很花时间，实际应用都会用矩阵计算来提升效率：</p>
<p><span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-43-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mfrac&gt;&lt;mi&gt;&amp;#x03B1;&lt;/mi&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mfrac&gt;&lt;mo stretchy=&quot;false&quot;&gt;[&lt;/mo&gt;&lt;munderover&gt;&lt;mo&gt;&amp;#x2211;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;]&lt;/mo&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-431" style="width: 13.144em; display: inline-block;"><span style="display: inline-block; position: relative; width: 11.218em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(0.792em, 1011.22em, 3.982em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-432"><span class="mi" id="MathJax-Span-433" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-434" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mi" id="MathJax-Span-435" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.313em;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-436" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="mfrac" id="MathJax-Span-437" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 0.842em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.405em, 1000.55em, 4.178em, -1000em); top: -4.683em; left: 50%; margin-left: -0.276em;"><span class="mi" id="MathJax-Span-438" style="font-family: STIXGeneral; font-style: italic;">α</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.405em, 1000.7em, 4.176em, -1000em); top: -3.32em; left: 50%; margin-left: -0.361em;"><span class="mi" id="MathJax-Span-439" style="font-family: STIXGeneral; font-style: italic;">m</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1000.84em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 0.842em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="mo" id="MathJax-Span-440" style="font-family: STIXGeneral;">[</span><span class="munderover" id="MathJax-Span-441"><span style="display: inline-block; position: relative; width: 1.292em; height: 0px;"><span style="position: absolute; clip: rect(2.871em, 1001.2em, 4.642em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-442" style="font-family: STIXSizeOneSym; vertical-align: -0.524em;">∑</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.96em, 4.274em, -1000em); top: -2.856em; left: 0.129em;"><span class="texatom" id="MathJax-Span-443"><span class="mrow" id="MathJax-Span-444"><span class="mi" id="MathJax-Span-445" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-446" style="font-size: 70.7%; font-family: STIXGeneral;">=</span><span class="mn" id="MathJax-Span-447" style="font-size: 70.7%; font-family: STIXGeneral;">1</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.434em, 1000.5em, 4.173em, -1000em); top: -5.206em; left: 0.391em;"><span class="texatom" id="MathJax-Span-448"><span class="mrow" id="MathJax-Span-449"><span class="mi" id="MathJax-Span-450" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-451" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-452"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-453" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-454" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-455" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-456" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="mi" id="MathJax-Span-457" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.25em;">y</span><span class="mo" id="MathJax-Span-458" style="font-family: STIXGeneral;">)</span><span class="mo" id="MathJax-Span-459" style="font-family: STIXGeneral;">]</span><span class="mi" id="MathJax-Span-460" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -1.534em; border-left: 0px solid; width: 0px; height: 3.482em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mi>θ</mi><mo>=</mo><mi>θ</mi><mo>−</mo><mfrac><mi>α</mi><mi>m</mi></mfrac><mo stretchy="false">[</mo><munderover><mo>∑</mo><mrow class="MJX-TeXAtom-ORD"><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow class="MJX-TeXAtom-ORD"><mi>m</mi></mrow></munderover><mo stretchy="false">(</mo><msup><mi>X</mi><mi>T</mi></msup><mi>θ</mi><mo>−</mo><mi>y</mi><mo stretchy="false">)</mo><mo stretchy="false">]</mo><mi>X</mi></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-43">
\theta=\theta-\frac{\alpha}{m}[\sum_{i=1}^{m}(X^T\theta-y)]X
</script></span></p>
<p>上式中的 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-44-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mo&gt;&amp;#x2211;&lt;/mo&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-461" style="width: 1.071em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.908em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.643em, 1000.85em, 2.985em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-462"><span class="mo" id="MathJax-Span-463" style="font-family: STIXGeneral; vertical-align: -0.002em;">∑</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.368em; border-left: 0px solid; width: 0px; height: 1.321em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mo>∑</mo></math></span></span><script type="math/tex" id="MathJax-Element-44">\sum</script></span> 表示将 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-45-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-464" style="width: 3.956em; display: inline-block;"><span style="display: inline-block; position: relative; width: 3.365em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.579em, 1003.35em, 2.93em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-465"><span class="msubsup" id="MathJax-Span-466"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-467" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.718em;"><span class="mi" id="MathJax-Span-468" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-469" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-470" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="mi" id="MathJax-Span-471" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.25em;">y</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.304em; border-left: 0px solid; width: 0px; height: 1.331em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msup><mi>X</mi><mi>T</mi></msup><mi>θ</mi><mo>−</mo><mi>y</mi></math></span></span><script type="math/tex" id="MathJax-Element-45">X^T\theta-y</script></span> 的所有元素相加，这种一次同时更新所有参数的形式叫做批量梯度下降法（Batch gradient descent），不断重复直至 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-46-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-472" style="width: 0.59em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.481em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.726em, 1000.48em, 2.735em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-473"><span class="mi" id="MathJax-Span-474" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.075em; border-left: 0px solid; width: 0px; height: 0.931em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>θ</mi></math></span></span><script type="math/tex" id="MathJax-Element-46">\theta</script></span> 收敛。(建议自己推导一下「=」右边的矩阵计算出来的结果是什么)</p>
<p>我用很短的篇幅简单介绍了线性回归模型实现的过程，你可能注意到有很多「坑」还没填，比如损失函数是怎么来的？变量不只一个怎么办？还有其他方法可以求解线性回归的模型吗？那就请接着往下看吧。</p>
<h3 id="多变量的线性回归">多变量的线性回归</h3>
<p>我们之前说的根据身高（<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-47-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-475" style="width: 0.751em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.641em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.751em, 1000.64em, 2.724em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-476"><span class="mi" id="MathJax-Span-477" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.063em; border-left: 0px solid; width: 0px; height: 0.889em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>X</mi></math></span></span><script type="math/tex" id="MathJax-Element-47">X</script></span>）来预测体重（<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-48-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-478" style="width: 0.537em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.427em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.963em, 1000.41em, 2.93em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-479"><span class="mi" id="MathJax-Span-480" style="font-family: STIXGeneral; font-style: italic;">y</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.304em; border-left: 0px solid; width: 0px; height: 0.882em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>y</mi></math></span></span><script type="math/tex" id="MathJax-Element-48">y</script></span>）是一个单变量的线性回归问题，我想用身高+性别来预测体重怎么办？其实非常简单，引入新的特征 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-49-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msub&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-481" style="width: 1.018em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.855em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.642em, 1000.86em, 2.554em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-482"><span class="msubsup" id="MathJax-Span-483"><span style="display: inline-block; position: relative; width: 0.873em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-484" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.444em;"><span class="mn" id="MathJax-Span-485" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.238em; border-left: 0px solid; width: 0px; height: 0.816em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>x</mi><mn>2</mn></msub></math></span></span><script type="math/tex" id="MathJax-Element-49">x_2</script></span> 表示性别（1表示男性，-1表示女性）即可，此时对应的「直线」是：</p>
<p><span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-50-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;msub&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;msub&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-486" style="width: 14.212em; display: inline-block;"><span style="display: inline-block; position: relative; width: 12.126em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.529em, 1012.13em, 2.884em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-487"><span class="msubsup" id="MathJax-Span-488"><span style="display: inline-block; position: relative; width: 0.924em; height: 0px;"><span style="position: absolute; clip: rect(3.163em, 1000.48em, 4.176em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-489" style="font-family: STIXGeneral; font-style: italic;">h</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.5em;"><span class="mi" id="MathJax-Span-490" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-491" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="msubsup" id="MathJax-Span-492" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-493" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mn" id="MathJax-Span-494" style="font-size: 70.7%; font-family: STIXGeneral;">0</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-495" style="font-family: STIXGeneral; padding-left: 0.25em;">+</span><span class="msubsup" id="MathJax-Span-496" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-497" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mn" id="MathJax-Span-498" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-499"><span style="display: inline-block; position: relative; width: 0.873em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-500" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.444em;"><span class="mn" id="MathJax-Span-501" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-502" style="font-family: STIXGeneral; padding-left: 0.25em;">+</span><span class="msubsup" id="MathJax-Span-503" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-504" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mn" id="MathJax-Span-505" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-506"><span style="display: inline-block; position: relative; width: 0.873em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-507" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.444em;"><span class="mn" id="MathJax-Span-508" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-509" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="msubsup" id="MathJax-Span-510" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-511" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-512" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-513" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.25em; border-left: 0px solid; width: 0px; height: 1.335em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><msub><mi>h</mi><mi>θ</mi></msub><mo>=</mo><msub><mi>θ</mi><mn>0</mn></msub><mo>+</mo><msub><mi>θ</mi><mn>1</mn></msub><msub><mi>x</mi><mn>1</mn></msub><mo>+</mo><msub><mi>θ</mi><mn>2</mn></msub><msub><mi>x</mi><mn>2</mn></msub><mo>=</mo><msup><mi>X</mi><mi>T</mi></msup><mi>θ</mi></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-50">
h_\theta=\theta_0+\theta_1x_1+\theta_2x_2=X^T\theta
</script></span></p>
<p>其中 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-51-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-514" style="width: 0.59em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.481em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.726em, 1000.48em, 2.735em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-515"><span class="mi" id="MathJax-Span-516" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.075em; border-left: 0px solid; width: 0px; height: 0.931em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>θ</mi></math></span></span><script type="math/tex" id="MathJax-Element-51">\theta</script></span> 是<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-52-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;&amp;#x00D7;&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-517" style="width: 2.513em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.137em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.728em, 1002.03em, 2.749em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-518"><span class="mn" id="MathJax-Span-519" style="font-family: STIXGeneral;">3</span><span class="mo" id="MathJax-Span-520" style="font-family: STIXGeneral; padding-left: 0.25em;">×</span><span class="mn" id="MathJax-Span-521" style="font-family: STIXGeneral; padding-left: 0.25em;">1</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.092em; border-left: 0px solid; width: 0px; height: 0.945em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>3</mn><mo>×</mo><mn>1</mn></math></span></span><script type="math/tex" id="MathJax-Element-52">3 \times1</script></span> 阶矢量</p>
<p><span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-53-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;[&lt;/mo&gt;&lt;mtable rowspacing=&quot;4pt&quot; columnspacing=&quot;1em&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;mo&gt;]&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-522" style="width: 4.65em; display: inline-block;"><span style="display: inline-block; position: relative; width: 3.953em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(2.341em, 1003.9em, 6.561em, -1000em); top: -4.701em; left: 0em;"><span class="mrow" id="MathJax-Span-523"><span class="mi" id="MathJax-Span-524" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-525" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mrow" id="MathJax-Span-526" style="padding-left: 0.313em;"><span class="mo" id="MathJax-Span-527" style="vertical-align: 2.2em;"><span style="display: inline-block; position: relative; width: 0.45em; height: 0px;"><span style="position: absolute; font-family: STIXSizeOneSym; top: -3.324em; left: 0em;">⎡<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; font-family: STIXSizeOneSym; top: -0.424em; left: 0em;">⎣<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: -2.358em; left: 0em;">⎢<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: -1.391em; left: 0em;">⎢<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mtable" id="MathJax-Span-528" style="padding-right: 0.167em; padding-left: 0.167em;"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(2.516em, 1000.91em, 6.565em, -1000em); top: -4.754em; left: 0em;"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.91em, 4.327em, -1000em); top: -5.406em; left: 50%; margin-left: -0.454em;"><span class="mtd" id="MathJax-Span-529"><span class="mrow" id="MathJax-Span-530"><span class="msubsup" id="MathJax-Span-531"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-532" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mn" id="MathJax-Span-533" style="font-size: 70.7%; font-family: STIXGeneral;">0</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.168em, 1000.91em, 4.317em, -1000em); top: -3.956em; left: 50%; margin-left: -0.454em;"><span class="mtd" id="MathJax-Span-534"><span class="mrow" id="MathJax-Span-535"><span class="msubsup" id="MathJax-Span-536"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-537" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mn" id="MathJax-Span-538" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.168em, 1000.91em, 4.317em, -1000em); top: -2.506em; left: 50%; margin-left: -0.454em;"><span class="mtd" id="MathJax-Span-539"><span class="mrow" id="MathJax-Span-540"><span class="msubsup" id="MathJax-Span-541"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-542" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mn" id="MathJax-Span-543" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.754em;"></span></span></span></span><span class="mo" id="MathJax-Span-544" style="vertical-align: 2.2em;"><span style="display: inline-block; position: relative; width: 0.45em; height: 0px;"><span style="position: absolute; font-family: STIXSizeOneSym; top: -3.324em; left: 0em;">⎤<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; font-family: STIXSizeOneSym; top: -0.424em; left: 0em;">⎦<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: -2.358em; left: 0em;">⎥<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: -1.391em; left: 0em;">⎥<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.701em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -2.052em; border-left: 0px solid; width: 0px; height: 4.688em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mi>θ</mi><mo>=</mo><mrow><mo>[</mo><mtable rowspacing="4pt" columnspacing="1em"><mtr><mtd><msub><mi>θ</mi><mn>0</mn></msub></mtd></mtr><mtr><mtd><msub><mi>θ</mi><mn>1</mn></msub></mtd></mtr><mtr><mtd><msub><mi>θ</mi><mn>2</mn></msub></mtd></mtr></mtable><mo>]</mo></mrow></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-53">
\theta=\left[ 
\begin{matrix}
\theta_0\\  \theta_1\\ \theta_2
  \end{matrix}\right]
</script></span></p>
<p><span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-54-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-545" style="width: 1.445em; display: inline-block;"><span style="display: inline-block; position: relative; width: 1.229em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.259em, 1001.23em, 2.404em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-546"><span class="msubsup" id="MathJax-Span-547"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-548" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.718em;"><span class="mi" id="MathJax-Span-549" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.063em; border-left: 0px solid; width: 0px; height: 1.09em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msup><mi>X</mi><mi>T</mi></msup></math></span></span><script type="math/tex" id="MathJax-Element-54">X^T</script></span> （<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-55-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mo&gt;&amp;#x00D7;&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-550" style="width: 2.78em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.35em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.728em, 1002.28em, 2.749em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-551"><span class="mi" id="MathJax-Span-552" style="font-family: STIXGeneral; font-style: italic;">m</span><span class="mo" id="MathJax-Span-553" style="font-family: STIXGeneral; padding-left: 0.25em;">×</span><span class="mn" id="MathJax-Span-554" style="font-family: STIXGeneral; padding-left: 0.25em;">3</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.092em; border-left: 0px solid; width: 0px; height: 0.945em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>m</mi><mo>×</mo><mn>3</mn></math></span></span><script type="math/tex" id="MathJax-Element-55">m\times3</script></span>）:</p>
<p><span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-56-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;[&lt;/mo&gt;&lt;mtable rowspacing=&quot;4pt&quot; columnspacing=&quot;1em&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msubsup&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msubsup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msubsup&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msubsup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msubsup&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msubsup&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msubsup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msubsup&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msubsup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msubsup&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mo&gt;.&lt;/mo&gt;&lt;mo&gt;.&lt;/mo&gt;&lt;mo&gt;.&lt;/mo&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/msubsup&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msubsup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/msubsup&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msubsup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/msubsup&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;mo&gt;]&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-555" style="width: 9.244em; display: inline-block;"><span style="display: inline-block; position: relative; width: 7.906em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(2.369em, 1007.86em, 8.455em, -1000em); top: -5.662em; left: 0em;"><span class="mrow" id="MathJax-Span-556"><span class="msubsup" id="MathJax-Span-557"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-558" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-559" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-560" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mrow" id="MathJax-Span-561" style="padding-left: 0.313em;"><span class="mo" id="MathJax-Span-562" style="vertical-align: 3.133em;"><span style="display: inline-block; position: relative; width: 0.45em; height: 0px;"><span style="position: absolute; font-family: STIXSizeOneSym; top: -3.324em; left: 0em;">⎡<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; font-family: STIXSizeOneSym; top: 1.441em; left: 0em;">⎣<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: -2.371em; left: 0em;">⎢<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: -1.418em; left: 0em;">⎢<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: -0.465em; left: 0em;">⎢<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: 0.488em; left: 0em;">⎢<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mtable" id="MathJax-Span-563" style="padding-right: 0.167em; padding-left: 0.167em;"><span style="display: inline-block; position: relative; width: 4.126em; height: 0px;"><span style="position: absolute; clip: rect(3.491em, 1004.13em, 9.577em, -1000em); top: -6.784em; left: 0em;"><span style="display: inline-block; position: relative; width: 4.126em; height: 0px;"><span style="position: absolute; clip: rect(3.024em, 1003.66em, 4.49em, -1000em); top: -6.317em; left: 50%; margin-left: -1.828em;"><span class="mtd" id="MathJax-Span-564"><span class="mrow" id="MathJax-Span-565"><span class="msubsup" id="MathJax-Span-566"><span style="display: inline-block; position: relative; width: 0.926em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-567" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -4.351em; left: 0.498em;"><span class="mn" id="MathJax-Span-568" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.177em, -1000em); top: -3.693em; left: 0.444em;"><span class="mn" id="MathJax-Span-569" style="font-size: 70.7%; font-family: STIXGeneral;">0</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-570" style="font-family: STIXGeneral;">,</span><span class="msubsup" id="MathJax-Span-571" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 0.926em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-572" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -4.351em; left: 0.498em;"><span class="mn" id="MathJax-Span-573" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -3.693em; left: 0.444em;"><span class="mn" id="MathJax-Span-574" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-575" style="font-family: STIXGeneral;">,</span><span class="msubsup" id="MathJax-Span-576" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 0.926em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-577" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -4.351em; left: 0.498em;"><span class="mn" id="MathJax-Span-578" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -3.693em; left: 0.444em;"><span class="mn" id="MathJax-Span-579" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.024em, 1003.66em, 4.49em, -1000em); top: -4.721em; left: 50%; margin-left: -1.828em;"><span class="mtd" id="MathJax-Span-580"><span class="mrow" id="MathJax-Span-581"><span class="msubsup" id="MathJax-Span-582"><span style="display: inline-block; position: relative; width: 0.926em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-583" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -4.351em; left: 0.498em;"><span class="mn" id="MathJax-Span-584" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.177em, -1000em); top: -3.693em; left: 0.444em;"><span class="mn" id="MathJax-Span-585" style="font-size: 70.7%; font-family: STIXGeneral;">0</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-586" style="font-family: STIXGeneral;">,</span><span class="msubsup" id="MathJax-Span-587" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 0.926em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-588" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -4.351em; left: 0.498em;"><span class="mn" id="MathJax-Span-589" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -3.693em; left: 0.444em;"><span class="mn" id="MathJax-Span-590" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-591" style="font-family: STIXGeneral;">,</span><span class="msubsup" id="MathJax-Span-592" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 0.926em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-593" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -4.351em; left: 0.498em;"><span class="mn" id="MathJax-Span-594" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -3.693em; left: 0.444em;"><span class="mn" id="MathJax-Span-595" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.746em, 1001.06em, 4.178em, -1000em); top: -3.147em; left: 50%; margin-left: -0.563em;"><span class="mtd" id="MathJax-Span-596"><span class="mrow" id="MathJax-Span-597"><span class="mo" id="MathJax-Span-598" style="font-family: STIXGeneral;">.</span><span class="mo" id="MathJax-Span-599" style="font-family: STIXGeneral; padding-left: 0.188em;">.</span><span class="mo" id="MathJax-Span-600" style="font-family: STIXGeneral; padding-left: 0.188em;">.</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.184em, 1004.13em, 4.49em, -1000em); top: -1.697em; left: 50%; margin-left: -2.063em;"><span class="mtd" id="MathJax-Span-601"><span class="mrow" id="MathJax-Span-602"><span class="msubsup" id="MathJax-Span-603"><span style="display: inline-block; position: relative; width: 1.083em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-604" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.534em, 1000.59em, 4.173em, -1000em); top: -4.357em; left: 0.498em;"><span class="mi" id="MathJax-Span-605" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.177em, -1000em); top: -3.693em; left: 0.444em;"><span class="mn" id="MathJax-Span-606" style="font-size: 70.7%; font-family: STIXGeneral;">0</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-607" style="font-family: STIXGeneral;">,</span><span class="msubsup" id="MathJax-Span-608" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 1.083em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-609" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.534em, 1000.59em, 4.173em, -1000em); top: -4.357em; left: 0.498em;"><span class="mi" id="MathJax-Span-610" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -3.693em; left: 0.444em;"><span class="mn" id="MathJax-Span-611" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-612" style="font-family: STIXGeneral;">,</span><span class="msubsup" id="MathJax-Span-613" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 1.083em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-614" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.534em, 1000.59em, 4.173em, -1000em); top: -4.357em; left: 0.498em;"><span class="mi" id="MathJax-Span-615" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.43em, 4.167em, -1000em); top: -3.693em; left: 0.444em;"><span class="mn" id="MathJax-Span-616" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 6.784em;"></span></span></span></span><span class="mo" id="MathJax-Span-617" style="vertical-align: 3.133em;"><span style="display: inline-block; position: relative; width: 0.45em; height: 0px;"><span style="position: absolute; font-family: STIXSizeOneSym; top: -3.324em; left: 0em;">⎤<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; font-family: STIXSizeOneSym; top: 1.441em; left: 0em;">⎦<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: -2.371em; left: 0em;">⎥<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: -1.418em; left: 0em;">⎥<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: -0.465em; left: 0em;">⎥<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXSizeOneSym; position: absolute; top: 0.488em; left: 0em;">⎥<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 5.662em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -3.143em; border-left: 0px solid; width: 0px; height: 6.87em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><msup><mi>X</mi><mi>T</mi></msup><mo>=</mo><mrow><mo>[</mo><mtable rowspacing="4pt" columnspacing="1em"><mtr><mtd><msubsup><mi>x</mi><mn>0</mn><mn>1</mn></msubsup><mo>,</mo><msubsup><mi>x</mi><mn>1</mn><mn>1</mn></msubsup><mo>,</mo><msubsup><mi>x</mi><mn>2</mn><mn>1</mn></msubsup></mtd></mtr><mtr><mtd><msubsup><mi>x</mi><mn>0</mn><mn>2</mn></msubsup><mo>,</mo><msubsup><mi>x</mi><mn>1</mn><mn>2</mn></msubsup><mo>,</mo><msubsup><mi>x</mi><mn>2</mn><mn>2</mn></msubsup></mtd></mtr><mtr><mtd><mo>.</mo><mo>.</mo><mo>.</mo></mtd></mtr><mtr><mtd><msubsup><mi>x</mi><mn>0</mn><mi>m</mi></msubsup><mo>,</mo><msubsup><mi>x</mi><mn>1</mn><mi>m</mi></msubsup><mo>,</mo><msubsup><mi>x</mi><mn>2</mn><mi>m</mi></msubsup></mtd></mtr></mtable><mo>]</mo></mrow></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-56">
X^T=\left[\begin{matrix}
x_0^1, x_1^1,x_2^1\\
x_0^2, x_1^2,x_2^2\\
...\\
x_0^m, x_1^m,x_2^m\\
\end{matrix}\right]
</script></span></p>
<p>将公式中的 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-57-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-618" style="width: 0.59em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.481em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.726em, 1000.48em, 2.735em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-619"><span class="mi" id="MathJax-Span-620" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.075em; border-left: 0px solid; width: 0px; height: 0.931em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>θ</mi></math></span></span><script type="math/tex" id="MathJax-Element-57">\theta</script></span> 和 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-58-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-621" style="width: 0.751em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.641em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.751em, 1000.64em, 2.724em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-622"><span class="mi" id="MathJax-Span-623" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.063em; border-left: 0px solid; width: 0px; height: 0.889em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>X</mi></math></span></span><script type="math/tex" id="MathJax-Element-58">X</script></span> 用新的矩阵代替即可，当变量继续增加时，我们只要相应地修改矩阵即可，非常的简单。</p>
<h3 id="损失函数是怎么来的">损失函数是怎么来的</h3>
<p class=" has-jax">我们先定义模型预测的误差 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-59-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03F5;&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-624" style="width: 9.03em; display: inline-block;"><span style="display: inline-block; position: relative; width: 7.692em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.563em, 1007.64em, 2.93em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-625"><span class="msubsup" id="MathJax-Span-626"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.42em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-627" style="font-family: STIXGeneral; font-style: italic;">ϵ</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.444em;"><span class="texatom" id="MathJax-Span-628"><span class="mrow" id="MathJax-Span-629"><span class="mo" id="MathJax-Span-630" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-631" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-632" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-633" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="msubsup" id="MathJax-Span-634" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-635" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.444em;"><span class="texatom" id="MathJax-Span-636"><span class="mrow" id="MathJax-Span-637"><span class="mo" id="MathJax-Span-638" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-639" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-640" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-641" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-642" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 0.924em; height: 0px;"><span style="position: absolute; clip: rect(3.163em, 1000.48em, 4.176em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-643" style="font-family: STIXGeneral; font-style: italic;">h</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.5em;"><span class="texatom" id="MathJax-Span-644"><span class="mrow" id="MathJax-Span-645"><span class="mi" id="MathJax-Span-646" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-647" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-648"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-649" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.498em;"><span class="texatom" id="MathJax-Span-650"><span class="mrow" id="MathJax-Span-651"><span class="mo" id="MathJax-Span-652" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-653" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-654" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-655" style="font-family: STIXGeneral;">)</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.304em; border-left: 0px solid; width: 0px; height: 1.35em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msup><mi>ϵ</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>=</mo><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>−</mo><msub><mi>h</mi><mrow class="MJX-TeXAtom-ORD"><mi>θ</mi></mrow></msub><mo stretchy="false">(</mo><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo stretchy="false">)</mo></math></span></span><script type="math/tex" id="MathJax-Element-59">\epsilon^{(i)}=y^{(i)}-h_{\theta}(x^{(i)})</script></span>，对于误差 <span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-60-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msup&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-656" style="width: 0.911em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.748em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.242em, 1000.75em, 2.404em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-657"><span class="msubsup" id="MathJax-Span-658"><span style="display: inline-block; position: relative; width: 0.743em; height: 0px;"><span style="position: absolute; clip: rect(3.846em, 1000em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-659"></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0em;"><span class="texatom" id="MathJax-Span-660"><span class="mrow" id="MathJax-Span-661"><span class="mo" id="MathJax-Span-662" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-663" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-664" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.063em; border-left: 0px solid; width: 0px; height: 1.109em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msup><mi></mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup></math></span></span><script type="math/tex" id="MathJax-Element-60">^{(i)} </script>，假设其服从正态分布： <span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-61-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03F5;&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;&amp;#x223C;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi class=&quot;MJX-tex-caligraphic&quot; mathvariant=&quot;script&quot;&gt;N&lt;/mi&gt;&lt;/mrow&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03C3;&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-665" style="width: 7.268em; display: inline-block;"><span style="display: inline-block; position: relative; width: 6.197em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(2.047em, 1006.15em, 3.436em, -1000em); top: -3.098em; left: 0em;"><span class="mrow" id="MathJax-Span-666"><span class="msubsup" id="MathJax-Span-667"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.42em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-668" style="font-family: STIXGeneral; font-style: italic;">ϵ</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.444em;"><span class="texatom" id="MathJax-Span-669"><span class="mrow" id="MathJax-Span-670"><span class="mo" id="MathJax-Span-671" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-672" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-673" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-674" style="font-family: STIXGeneral; padding-left: 0.313em;">∼</span><span class="texatom" id="MathJax-Span-675" style="padding-left: 0.313em;"><span class="mrow" id="MathJax-Span-676"><span class="mi" id="MathJax-Span-677" style="font-family: STIXNonUnicode; font-style: italic;"><span style="display: inline-block; overflow: hidden; height: 1px; width: 0.107em;"></span></span></span></span><span class="mo" id="MathJax-Span-678" style="font-family: STIXGeneral;">(</span><span class="mn" id="MathJax-Span-679" style="font-family: STIXGeneral;">0</span><span class="mo" id="MathJax-Span-680" style="font-family: STIXGeneral;">,</span><span class="msubsup" id="MathJax-Span-681" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 1.019em; height: 0px;"><span style="position: absolute; clip: rect(3.418em, 1000.53em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-682" style="font-family: STIXGeneral; font-style: italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.033em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.591em;"><span class="mn" id="MathJax-Span-683" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-684" style="font-family: STIXGeneral;">)</span></span><span style="display: inline-block; width: 0px; height: 3.098em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.27em; border-left: 0px solid; width: 0px; height: 1.374em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><msup><mi>ϵ</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>∼</mo><mrow class="MJX-TeXAtom-ORD"><mi class="MJX-tex-caligraphic" mathvariant="script">N</mi></mrow><mo stretchy="false">(</mo><mn>0</mn><mo>,</mo><msup><mi>σ</mi><mn>2</mn></msup><mo stretchy="false">)</mo></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-61">
\epsilon^{(i)} \sim\mathcal{N}(0,\sigma^2)
</script></span> 根据正态分布的性质，我们知道 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-62-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;&amp;#x223C;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi class=&quot;MJX-tex-caligraphic&quot; mathvariant=&quot;script&quot;&gt;N&lt;/mi&gt;&lt;/mrow&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03C3;&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-685" style="width: 9.939em; display: inline-block;"><span style="display: inline-block; position: relative; width: 8.494em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(2.097em, 1008.45em, 3.465em, -1000em); top: -3.098em; left: 0em;"><span class="mrow" id="MathJax-Span-686"><span class="msubsup" id="MathJax-Span-687"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-688" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.444em;"><span class="texatom" id="MathJax-Span-689"><span class="mrow" id="MathJax-Span-690"><span class="mo" id="MathJax-Span-691" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-692" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-693" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-694" style="font-family: STIXGeneral; padding-left: 0.313em;">∼</span><span class="texatom" id="MathJax-Span-695" style="padding-left: 0.313em;"><span class="mrow" id="MathJax-Span-696"><span class="mi" id="MathJax-Span-697" style="font-family: STIXNonUnicode; font-style: italic;"><span style="display: inline-block; overflow: hidden; height: 1px; width: 0.107em;"></span></span></span></span><span class="mo" id="MathJax-Span-698" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-699"><span style="display: inline-block; position: relative; width: 0.924em; height: 0px;"><span style="position: absolute; clip: rect(3.163em, 1000.48em, 4.176em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-700" style="font-family: STIXGeneral; font-style: italic;">h</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.5em;"><span class="texatom" id="MathJax-Span-701"><span class="mrow" id="MathJax-Span-702"><span class="mi" id="MathJax-Span-703" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-704" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-705"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-706" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.498em;"><span class="texatom" id="MathJax-Span-707"><span class="mrow" id="MathJax-Span-708"><span class="mo" id="MathJax-Span-709" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-710" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-711" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-712" style="font-family: STIXGeneral;">)</span><span class="mo" id="MathJax-Span-713" style="font-family: STIXGeneral;">,</span><span class="msubsup" id="MathJax-Span-714" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 1.019em; height: 0px;"><span style="position: absolute; clip: rect(3.418em, 1000.53em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-715" style="font-family: STIXGeneral; font-style: italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.033em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.591em;"><span class="mn" id="MathJax-Span-716" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-717" style="font-family: STIXGeneral;">)</span></span><span style="display: inline-block; width: 0px; height: 3.098em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.304em; border-left: 0px solid; width: 0px; height: 1.35em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>∼</mo><mrow class="MJX-TeXAtom-ORD"><mi class="MJX-tex-caligraphic" mathvariant="script">N</mi></mrow><mo stretchy="false">(</mo><msub><mi>h</mi><mrow class="MJX-TeXAtom-ORD"><mi>θ</mi></mrow></msub><mo stretchy="false">(</mo><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo stretchy="false">)</mo><mo>,</mo><msup><mi>σ</mi><mn>2</mn></msup><mo stretchy="false">)</mo></math></span></span><script type="math/tex" id="MathJax-Element-62">y^{(i)} \sim\mathcal{N}(h_{\theta}(x^{(i)}),\sigma^2)</script></span>，据此写出<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-63-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-718" style="width: 1.392em; display: inline-block;"><span style="display: inline-block; position: relative; width: 1.175em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.242em, 1001.18em, 2.61em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-719"><span class="msubsup" id="MathJax-Span-720"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-721" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.444em;"><span class="texatom" id="MathJax-Span-722"><span class="mrow" id="MathJax-Span-723"><span class="mo" id="MathJax-Span-724" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-725" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-726" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.304em; border-left: 0px solid; width: 0px; height: 1.35em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup></math></span></span><script type="math/tex" id="MathJax-Element-63">y^{(i)}</script></span> 的概率密度函数： <span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-64-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mi&gt;p&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;|&lt;/mo&gt;&lt;/mrow&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;;&lt;/mo&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mrow&gt;&lt;msqrt&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;&amp;#x03C0;&lt;/mi&gt;&lt;/msqrt&gt;&lt;mi&gt;&amp;#x03C3;&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;msup&gt;&lt;mi&gt;e&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03C3;&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-727" style="width: 15.708em; display: inline-block;"><span style="display: inline-block; position: relative; width: 13.408em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(0.796em, 1013.41em, 3.652em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-728"><span class="mi" id="MathJax-Span-729" style="font-family: STIXGeneral; font-style: italic;">p</span><span class="mo" id="MathJax-Span-730" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-731"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-732" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.444em;"><span class="texatom" id="MathJax-Span-733"><span class="mrow" id="MathJax-Span-734"><span class="mo" id="MathJax-Span-735" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-736" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-737" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="texatom" id="MathJax-Span-738"><span class="mrow" id="MathJax-Span-739"><span class="mo" id="MathJax-Span-740" style="font-family: STIXVariants;">|</span></span></span><span class="msubsup" id="MathJax-Span-741"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-742" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.498em;"><span class="texatom" id="MathJax-Span-743"><span class="mrow" id="MathJax-Span-744"><span class="mo" id="MathJax-Span-745" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-746" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-747" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-748" style="font-family: STIXGeneral;">;</span><span class="mi" id="MathJax-Span-749" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.188em;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-750" style="font-family: STIXGeneral;">)</span><span class="mo" id="MathJax-Span-751" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mfrac" id="MathJax-Span-752" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 2.449em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.17em, 1000.39em, 4.167em, -1000em); top: -4.683em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-753" style="font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.03em, 1002.33em, 4.305em, -1000em); top: -3.217em; left: 50%; margin-left: -1.165em;"><span class="mrow" id="MathJax-Span-754"><span class="msqrt" id="MathJax-Span-755"><span style="display: inline-block; position: relative; width: 1.798em; height: 0px;"><span style="position: absolute; clip: rect(3.17em, 1001.04em, 4.185em, -1000em); top: -4.006em; left: 0.737em;"><span class="mrow" id="MathJax-Span-756"><span class="mn" id="MathJax-Span-757" style="font-family: STIXGeneral;">2</span><span class="mi" id="MathJax-Span-758" style="font-family: STIXGeneral; font-style: italic;">π<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.032em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.026em, 1001.06em, 3.397em, -1000em); top: -4.002em; left: 0.737em;"><span style="display: inline-block; position: relative; width: 1.061em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral; top: -4.006em; left: 0em;">‾<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; font-family: STIXGeneral; top: -4.006em; left: 0.561em;">‾<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXGeneral; position: absolute; top: -4.006em; left: 0.268em;">‾<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.903em, 1000.77em, 4.178em, -1000em); top: -3.879em; left: 0em;"><span style="font-family: STIXVariants;">√</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-759" style="font-family: STIXGeneral; font-style: italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.033em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1002.45em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 2.449em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-760"><span style="display: inline-block; position: relative; width: 4.542em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.41em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-761" style="font-family: STIXGeneral; font-style: italic;">e</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.585em; left: 0.444em;"><span class="texatom" id="MathJax-Span-762"><span class="mrow" id="MathJax-Span-763"><span class="mo" id="MathJax-Span-764" style="font-size: 70.7%; font-family: STIXGeneral;">−</span><span class="mfrac" id="MathJax-Span-765"><span style="display: inline-block; position: relative; width: 3.299em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.327em, 1003.18em, 4.339em, -1000em); top: -4.516em; left: 50%; margin-left: -1.589em;"><span class="mrow" id="MathJax-Span-766"><span class="mo" id="MathJax-Span-767" style="font-size: 50%; font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-768"><span style="display: inline-block; position: relative; width: 0.732em; height: 0px;"><span style="position: absolute; clip: rect(3.626em, 1000.21em, 4.27em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-769" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.188em; left: 0.222em;"><span class="texatom" id="MathJax-Span-770"><span class="mrow" id="MathJax-Span-771"><span class="mo" id="MathJax-Span-772" style="font-size: 50%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-773" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-774" style="font-size: 50%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-775" style="font-size: 50%; font-family: STIXGeneral;">−</span><span class="msubsup" id="MathJax-Span-776"><span style="display: inline-block; position: relative; width: 0.535em; height: 0px;"><span style="position: absolute; clip: rect(3.505em, 1000.24em, 4.171em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-777" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">h</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.84em; left: 0.25em;"><span class="texatom" id="MathJax-Span-778"><span class="mrow" id="MathJax-Span-779"><span class="mi" id="MathJax-Span-780" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.007em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-781" style="font-size: 50%; font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-782"><span style="display: inline-block; position: relative; width: 0.783em; height: 0px;"><span style="position: absolute; clip: rect(3.626em, 1000.22em, 4.172em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-783" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.188em; left: 0.274em;"><span class="texatom" id="MathJax-Span-784"><span class="mrow" id="MathJax-Span-785"><span class="mo" id="MathJax-Span-786" style="font-size: 50%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-787" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-788" style="font-size: 50%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-789"><span style="display: inline-block; position: relative; width: 0.454em; height: 0px;"><span style="position: absolute; clip: rect(3.508em, 1000.14em, 4.255em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-790" style="font-size: 50%; font-family: STIXGeneral;">)</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.188em; left: 0.167em;"><span class="mn" id="MathJax-Span-791" style="font-size: 50%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.364em, 1000.86em, 4.172em, -1000em); top: -3.541em; left: 50%; margin-left: -0.429em;"><span class="mrow" id="MathJax-Span-792"><span class="mn" id="MathJax-Span-793" style="font-size: 50%; font-family: STIXGeneral;">2</span><span class="msubsup" id="MathJax-Span-794"><span style="display: inline-block; position: relative; width: 0.608em; height: 0px;"><span style="position: absolute; clip: rect(3.632em, 1000.27em, 4.172em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-795" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.017em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.151em; left: 0.32em;"><span class="mn" id="MathJax-Span-796" style="font-size: 50%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1003.3em, 1.229em, -1000em); top: -1.215em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 3.299em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -1.148em; border-left: 0px solid; width: 0px; height: 3.091em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mi>p</mi><mo stretchy="false">(</mo><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">|</mo></mrow><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>;</mo><mi>θ</mi><mo stretchy="false">)</mo><mo>=</mo><mfrac><mn>1</mn><mrow><msqrt><mn>2</mn><mi>π</mi></msqrt><mi>σ</mi></mrow></mfrac><msup><mi>e</mi><mrow class="MJX-TeXAtom-ORD"><mo>−</mo><mfrac><mrow><mo stretchy="false">(</mo><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>−</mo><msub><mi>h</mi><mrow class="MJX-TeXAtom-ORD"><mi>θ</mi></mrow></msub><mo stretchy="false">(</mo><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><msup><mo stretchy="false">)</mo><mn>2</mn></msup></mrow><mrow><mn>2</mn><msup><mi>σ</mi><mn>2</mn></msup></mrow></mfrac></mrow></msup></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-64">
p(y^{(i)}|x^{(i)};\theta)=\frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{(y^{(i)}-h_{\theta}(x^{(i)})^2}{2\sigma^2}}
</script></span> 让我们来捋一捋，这里 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-65-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;p&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-797" style="width: 0.59em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.481em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.963em, 1000.45em, 2.929em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-798"><span class="mi" id="MathJax-Span-799" style="font-family: STIXGeneral; font-style: italic;">p</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.302em; border-left: 0px solid; width: 0px; height: 0.881em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>p</mi></math></span></span><script type="math/tex" id="MathJax-Element-65">p</script></span> 描述的是以 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-66-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-800" style="width: 0.59em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.481em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.726em, 1000.48em, 2.735em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-801"><span class="mi" id="MathJax-Span-802" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.075em; border-left: 0px solid; width: 0px; height: 0.931em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>θ</mi></math></span></span><script type="math/tex" id="MathJax-Element-66">\theta</script></span> 为参数，在 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-67-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-803" style="width: 1.445em; display: inline-block;"><span style="display: inline-block; position: relative; width: 1.229em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.242em, 1001.23em, 2.415em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-804"><span class="msubsup" id="MathJax-Span-805"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-806" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.498em;"><span class="texatom" id="MathJax-Span-807"><span class="mrow" id="MathJax-Span-808"><span class="mo" id="MathJax-Span-809" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-810" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-811" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.075em; border-left: 0px solid; width: 0px; height: 1.122em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup></math></span></span><script type="math/tex" id="MathJax-Element-67">x^{(i)}</script></span> 已知的情况下，预测结果等于 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-68-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-812" style="width: 1.392em; display: inline-block;"><span style="display: inline-block; position: relative; width: 1.175em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.242em, 1001.18em, 2.61em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-813"><span class="msubsup" id="MathJax-Span-814"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-815" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.444em;"><span class="texatom" id="MathJax-Span-816"><span class="mrow" id="MathJax-Span-817"><span class="mo" id="MathJax-Span-818" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-819" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-820" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.304em; border-left: 0px solid; width: 0px; height: 1.35em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup></math></span></span><script type="math/tex" id="MathJax-Element-68">y^{(i)}</script></span> 的概率，注意只针对 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-69-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-821" style="width: 4.169em; display: inline-block;"><span style="display: inline-block; position: relative; width: 3.526em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.563em, 1003.48em, 2.93em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-822"><span class="mo" id="MathJax-Span-823" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-824"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-825" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.498em;"><span class="texatom" id="MathJax-Span-826"><span class="mrow" id="MathJax-Span-827"><span class="mo" id="MathJax-Span-828" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-829" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-830" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-831" style="font-family: STIXGeneral;">,</span><span class="msubsup" id="MathJax-Span-832" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-833" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.444em;"><span class="texatom" id="MathJax-Span-834"><span class="mrow" id="MathJax-Span-835"><span class="mo" id="MathJax-Span-836" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-837" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-838" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-839" style="font-family: STIXGeneral;">)</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.304em; border-left: 0px solid; width: 0px; height: 1.35em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mo stretchy="false">(</mo><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>,</mo><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo stretchy="false">)</mo></math></span></span><script type="math/tex" id="MathJax-Element-69">(x^{(i)}, y^{(i)})</script></span> 这一个数据，我们关心的是对于所有的训练数据，预测结果全中的概率，考虑到训练数据之间相互独立，所有训练数据预测结果都对的概率为： <span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-70-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mi&gt;p&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo&gt;&amp;#x220F;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mi&gt;p&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;|&lt;/mo&gt;&lt;/mrow&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;;&lt;/mo&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-840" style="width: 9.618em; display: inline-block;"><span style="display: inline-block; position: relative; width: 8.226em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(0.792em, 1008.18em, 3.983em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-841"><span class="mi" id="MathJax-Span-842" style="font-family: STIXGeneral; font-style: italic;">p</span><span class="mo" id="MathJax-Span-843" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="munderover" id="MathJax-Span-844" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 1.355em; height: 0px;"><span style="position: absolute; clip: rect(2.871em, 1001.31em, 4.642em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-845" style="font-family: STIXSizeOneSym; vertical-align: -0.524em;">∏</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.96em, 4.274em, -1000em); top: -2.856em; left: 0.16em;"><span class="texatom" id="MathJax-Span-846"><span class="mrow" id="MathJax-Span-847"><span class="mi" id="MathJax-Span-848" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-849" style="font-size: 70.7%; font-family: STIXGeneral;">=</span><span class="mn" id="MathJax-Span-850" style="font-size: 70.7%; font-family: STIXGeneral;">1</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.434em, 1000.5em, 4.173em, -1000em); top: -5.207em; left: 0.422em;"><span class="texatom" id="MathJax-Span-851"><span class="mrow" id="MathJax-Span-852"><span class="mi" id="MathJax-Span-853" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-854" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.188em;">p</span><span class="mo" id="MathJax-Span-855" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-856"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-857" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.444em;"><span class="texatom" id="MathJax-Span-858"><span class="mrow" id="MathJax-Span-859"><span class="mo" id="MathJax-Span-860" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-861" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-862" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="texatom" id="MathJax-Span-863"><span class="mrow" id="MathJax-Span-864"><span class="mo" id="MathJax-Span-865" style="font-family: STIXVariants;">|</span></span></span><span class="msubsup" id="MathJax-Span-866"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-867" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.498em;"><span class="texatom" id="MathJax-Span-868"><span class="mrow" id="MathJax-Span-869"><span class="mo" id="MathJax-Span-870" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-871" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-872" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-873" style="font-family: STIXGeneral;">;</span><span class="mi" id="MathJax-Span-874" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.188em;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-875" style="font-family: STIXGeneral;">)</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -1.535em; border-left: 0px solid; width: 0px; height: 3.484em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mi>p</mi><mo>=</mo><munderover><mo>∏</mo><mrow class="MJX-TeXAtom-ORD"><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow class="MJX-TeXAtom-ORD"><mi>m</mi></mrow></munderover><mi>p</mi><mo stretchy="false">(</mo><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">|</mo></mrow><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>;</mo><mi>θ</mi><mo stretchy="false">)</mo></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-70">
p=\prod_{i=1}^{m}p(y^{(i)}|x^{(i)};\theta)
</script></span> 接下来要做的就是让这个概率尽可能的大。熟悉的味道，已知结果 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-71-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-876" style="width: 6.253em; display: inline-block;"><span style="display: inline-block; position: relative; width: 5.342em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.563em, 1005.29em, 2.93em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-877"><span class="msubsup" id="MathJax-Span-878"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-879" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.444em;"><span class="texatom" id="MathJax-Span-880"><span class="mrow" id="MathJax-Span-881"><span class="mo" id="MathJax-Span-882" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-883" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-884" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-885" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="msubsup" id="MathJax-Span-886" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 0.924em; height: 0px;"><span style="position: absolute; clip: rect(3.163em, 1000.48em, 4.176em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-887" style="font-family: STIXGeneral; font-style: italic;">h</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.5em;"><span class="texatom" id="MathJax-Span-888"><span class="mrow" id="MathJax-Span-889"><span class="mi" id="MathJax-Span-890" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-891" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-892"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-893" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.498em;"><span class="texatom" id="MathJax-Span-894"><span class="mrow" id="MathJax-Span-895"><span class="mo" id="MathJax-Span-896" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-897" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-898" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-899" style="font-family: STIXGeneral;">)</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.304em; border-left: 0px solid; width: 0px; height: 1.35em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>=</mo><msub><mi>h</mi><mrow class="MJX-TeXAtom-ORD"><mi>θ</mi></mrow></msub><mo stretchy="false">(</mo><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo stretchy="false">)</mo></math></span></span><script type="math/tex" id="MathJax-Element-71">y^{(i)}=h_{\theta}(x^{(i)})</script></span>，参数 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-72-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-900" style="width: 0.59em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.481em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.726em, 1000.48em, 2.735em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-901"><span class="mi" id="MathJax-Span-902" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.075em; border-left: 0px solid; width: 0px; height: 0.931em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>θ</mi></math></span></span><script type="math/tex" id="MathJax-Element-72">\theta</script></span> 未定，此处需要进行最大似然估计，如果你看过我之前的文章<a href="http://fangs.in/post/thinkstats/likelihood">似然与极大似然估计</a>，下面这一步是无比顺溜的： <span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-73-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mtable columnalign=&quot;right left&quot; rowspacing=&quot;3pt&quot; columnspacing=&quot;0em&quot; displaystyle=&quot;true&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi class=&quot;MJX-tex-caligraphic&quot; mathvariant=&quot;script&quot;&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo&gt;&amp;#x220F;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mi&gt;p&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;|&lt;/mo&gt;&lt;/mrow&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;;&lt;/mo&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd /&gt;&lt;mtd&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo&gt;&amp;#x220F;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mrow&gt;&lt;msqrt&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;&amp;#x03C0;&lt;/mi&gt;&lt;/msqrt&gt;&lt;mi&gt;&amp;#x03C3;&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;msup&gt;&lt;mi&gt;e&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03C3;&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-903" style="width: 13.037em; display: inline-block;"><span style="display: inline-block; position: relative; width: 11.111em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(-1.206em, 1010.94em, 5.193em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-904"><span class="mtable" id="MathJax-Span-905" style="padding-right: 0.167em; padding-left: 0.167em;"><span style="display: inline-block; position: relative; width: 10.778em; height: 0px;"><span style="position: absolute; clip: rect(2.354em, 1000.65em, 6.552em, -1000em); top: -4.861em; left: 0em;"><span style="display: inline-block; position: relative; width: 0.693em; height: 0px;"><span style="position: absolute; clip: rect(3.176em, 1000.65em, 4.174em, -1000em); top: -5.683em; right: 0em;"><span class="mtd" id="MathJax-Span-906"><span class="mrow" id="MathJax-Span-907"><span class="texatom" id="MathJax-Span-908"><span class="mrow" id="MathJax-Span-909"><span class="mi" id="MathJax-Span-910" style="font-family: STIXNonUnicode; font-style: italic;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.846em, 1000em, 4.167em, -1000em); top: -2.475em; right: 0em;"><span class="mtd" id="MathJax-Span-947"><span class="mrow" id="MathJax-Span-948"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.861em;"></span></span><span style="position: absolute; clip: rect(3.655em, 1010.09em, 10.054em, -1000em); top: -7.105em; left: 0.693em;"><span style="display: inline-block; position: relative; width: 10.085em; height: 0px;"><span style="position: absolute; clip: rect(2.234em, 1007.68em, 5.425em, -1000em); top: -5.683em; left: 0em;"><span class="mtd" id="MathJax-Span-911"><span class="mrow" id="MathJax-Span-912"><span class="mi" id="MathJax-Span-913"></span><span class="mo" id="MathJax-Span-914" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="munderover" id="MathJax-Span-915" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 1.355em; height: 0px;"><span style="position: absolute; clip: rect(2.871em, 1001.31em, 4.642em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-916" style="font-family: STIXSizeOneSym; vertical-align: -0.524em;">∏</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.96em, 4.274em, -1000em); top: -2.856em; left: 0.16em;"><span class="texatom" id="MathJax-Span-917"><span class="mrow" id="MathJax-Span-918"><span class="mi" id="MathJax-Span-919" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-920" style="font-size: 70.7%; font-family: STIXGeneral;">=</span><span class="mn" id="MathJax-Span-921" style="font-size: 70.7%; font-family: STIXGeneral;">1</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.434em, 1000.5em, 4.173em, -1000em); top: -5.207em; left: 0.422em;"><span class="texatom" id="MathJax-Span-922"><span class="mrow" id="MathJax-Span-923"><span class="mi" id="MathJax-Span-924" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-925" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.188em;">p</span><span class="mo" id="MathJax-Span-926" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-927"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-928" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.444em;"><span class="texatom" id="MathJax-Span-929"><span class="mrow" id="MathJax-Span-930"><span class="mo" id="MathJax-Span-931" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-932" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-933" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="texatom" id="MathJax-Span-934"><span class="mrow" id="MathJax-Span-935"><span class="mo" id="MathJax-Span-936" style="font-family: STIXVariants;">|</span></span></span><span class="msubsup" id="MathJax-Span-937"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-938" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.498em;"><span class="texatom" id="MathJax-Span-939"><span class="mrow" id="MathJax-Span-940"><span class="mo" id="MathJax-Span-941" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-942" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-943" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-944" style="font-family: STIXGeneral;">;</span><span class="mi" id="MathJax-Span-945" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.188em;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-946" style="font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.234em, 1010.09em, 5.425em, -1000em); top: -2.475em; left: 0em;"><span class="mtd" id="MathJax-Span-949"><span class="mrow" id="MathJax-Span-950"><span class="mi" id="MathJax-Span-951"></span><span class="mo" id="MathJax-Span-952" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="munderover" id="MathJax-Span-953" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 1.355em; height: 0px;"><span style="position: absolute; clip: rect(2.871em, 1001.31em, 4.642em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-954" style="font-family: STIXSizeOneSym; vertical-align: -0.524em;">∏</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.96em, 4.274em, -1000em); top: -2.856em; left: 0.16em;"><span class="texatom" id="MathJax-Span-955"><span class="mrow" id="MathJax-Span-956"><span class="mi" id="MathJax-Span-957" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-958" style="font-size: 70.7%; font-family: STIXGeneral;">=</span><span class="mn" id="MathJax-Span-959" style="font-size: 70.7%; font-family: STIXGeneral;">1</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.434em, 1000.5em, 4.173em, -1000em); top: -5.207em; left: 0.422em;"><span class="texatom" id="MathJax-Span-960"><span class="mrow" id="MathJax-Span-961"><span class="mi" id="MathJax-Span-962" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mfrac" id="MathJax-Span-963" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 2.449em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.17em, 1000.39em, 4.167em, -1000em); top: -4.683em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-964" style="font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.03em, 1002.33em, 4.305em, -1000em); top: -3.217em; left: 50%; margin-left: -1.165em;"><span class="mrow" id="MathJax-Span-965"><span class="msqrt" id="MathJax-Span-966"><span style="display: inline-block; position: relative; width: 1.798em; height: 0px;"><span style="position: absolute; clip: rect(3.17em, 1001.04em, 4.185em, -1000em); top: -4.006em; left: 0.737em;"><span class="mrow" id="MathJax-Span-967"><span class="mn" id="MathJax-Span-968" style="font-family: STIXGeneral;">2</span><span class="mi" id="MathJax-Span-969" style="font-family: STIXGeneral; font-style: italic;">π<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.032em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.026em, 1001.06em, 3.397em, -1000em); top: -4.002em; left: 0.737em;"><span style="display: inline-block; position: relative; width: 1.061em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral; top: -4.006em; left: 0em;">‾<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; font-family: STIXGeneral; top: -4.006em; left: 0.561em;">‾<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXGeneral; position: absolute; top: -4.006em; left: 0.268em;">‾<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.903em, 1000.77em, 4.178em, -1000em); top: -3.879em; left: 0em;"><span style="font-family: STIXVariants;">√</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-970" style="font-family: STIXGeneral; font-style: italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.033em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1002.45em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 2.449em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-971"><span style="display: inline-block; position: relative; width: 4.542em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.41em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-972" style="font-family: STIXGeneral; font-style: italic;">e</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.585em; left: 0.444em;"><span class="texatom" id="MathJax-Span-973"><span class="mrow" id="MathJax-Span-974"><span class="mo" id="MathJax-Span-975" style="font-size: 70.7%; font-family: STIXGeneral;">−</span><span class="mfrac" id="MathJax-Span-976"><span style="display: inline-block; position: relative; width: 3.299em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.327em, 1003.18em, 4.339em, -1000em); top: -4.516em; left: 50%; margin-left: -1.589em;"><span class="mrow" id="MathJax-Span-977"><span class="mo" id="MathJax-Span-978" style="font-size: 50%; font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-979"><span style="display: inline-block; position: relative; width: 0.732em; height: 0px;"><span style="position: absolute; clip: rect(3.626em, 1000.21em, 4.27em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-980" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.188em; left: 0.222em;"><span class="texatom" id="MathJax-Span-981"><span class="mrow" id="MathJax-Span-982"><span class="mo" id="MathJax-Span-983" style="font-size: 50%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-984" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-985" style="font-size: 50%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-986" style="font-size: 50%; font-family: STIXGeneral;">−</span><span class="msubsup" id="MathJax-Span-987"><span style="display: inline-block; position: relative; width: 0.535em; height: 0px;"><span style="position: absolute; clip: rect(3.505em, 1000.24em, 4.171em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-988" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">h</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.84em; left: 0.25em;"><span class="texatom" id="MathJax-Span-989"><span class="mrow" id="MathJax-Span-990"><span class="mi" id="MathJax-Span-991" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.007em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-992" style="font-size: 50%; font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-993"><span style="display: inline-block; position: relative; width: 0.783em; height: 0px;"><span style="position: absolute; clip: rect(3.626em, 1000.22em, 4.172em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-994" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.188em; left: 0.274em;"><span class="texatom" id="MathJax-Span-995"><span class="mrow" id="MathJax-Span-996"><span class="mo" id="MathJax-Span-997" style="font-size: 50%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-998" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-999" style="font-size: 50%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1000"><span style="display: inline-block; position: relative; width: 0.454em; height: 0px;"><span style="position: absolute; clip: rect(3.508em, 1000.14em, 4.255em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1001" style="font-size: 50%; font-family: STIXGeneral;">)</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.188em; left: 0.167em;"><span class="mn" id="MathJax-Span-1002" style="font-size: 50%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.364em, 1000.86em, 4.172em, -1000em); top: -3.541em; left: 50%; margin-left: -0.429em;"><span class="mrow" id="MathJax-Span-1003"><span class="mn" id="MathJax-Span-1004" style="font-size: 50%; font-family: STIXGeneral;">2</span><span class="msubsup" id="MathJax-Span-1005"><span style="display: inline-block; position: relative; width: 0.608em; height: 0px;"><span style="position: absolute; clip: rect(3.632em, 1000.27em, 4.172em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1006" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.017em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.151em; left: 0.32em;"><span class="mn" id="MathJax-Span-1007" style="font-size: 50%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1003.3em, 1.229em, -1000em); top: -1.215em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 3.299em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 7.105em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -3.326em; border-left: 0px solid; width: 0px; height: 7.237em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mtable columnalign="right left" rowspacing="3pt" columnspacing="0em" displaystyle="true"><mtr><mtd><mrow class="MJX-TeXAtom-ORD"><mi class="MJX-tex-caligraphic" mathvariant="script">L</mi></mrow></mtd><mtd><mi></mi><mo>=</mo><munderover><mo>∏</mo><mrow class="MJX-TeXAtom-ORD"><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow class="MJX-TeXAtom-ORD"><mi>m</mi></mrow></munderover><mi>p</mi><mo stretchy="false">(</mo><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">|</mo></mrow><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>;</mo><mi>θ</mi><mo stretchy="false">)</mo></mtd></mtr><mtr><mtd></mtd><mtd><mi></mi><mo>=</mo><munderover><mo>∏</mo><mrow class="MJX-TeXAtom-ORD"><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow class="MJX-TeXAtom-ORD"><mi>m</mi></mrow></munderover><mfrac><mn>1</mn><mrow><msqrt><mn>2</mn><mi>π</mi></msqrt><mi>σ</mi></mrow></mfrac><msup><mi>e</mi><mrow class="MJX-TeXAtom-ORD"><mo>−</mo><mfrac><mrow><mo stretchy="false">(</mo><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>−</mo><msub><mi>h</mi><mrow class="MJX-TeXAtom-ORD"><mi>θ</mi></mrow></msub><mo stretchy="false">(</mo><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><msup><mo stretchy="false">)</mo><mn>2</mn></msup></mrow><mrow><mn>2</mn><msup><mi>σ</mi><mn>2</mn></msup></mrow></mfrac></mrow></msup></mtd></mtr></mtable></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-73">
\begin{split}
\mathcal{L}&=\prod_{i=1}^{m}p(y^{(i)}|x^{(i)};\theta)\\
&=\prod_{i=1}^{m}\frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{(y^{(i)}-h_{\theta}(x^{(i)})^2}{2\sigma^2}}\\
\end{split}
</script></span> 将 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-74-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi class=&quot;MJX-tex-caligraphic&quot; mathvariant=&quot;script&quot;&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1008" style="width: 0.857em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.694em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(2.268em, 1000.65em, 3.266em, -1000em); top: -3.098em; left: 0em;"><span class="mrow" id="MathJax-Span-1009"><span class="texatom" id="MathJax-Span-1010"><span class="mrow" id="MathJax-Span-1011"><span class="mi" id="MathJax-Span-1012" style="font-family: STIXNonUnicode; font-style: italic;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 3.098em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.071em; border-left: 0px solid; width: 0px; height: 0.917em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow class="MJX-TeXAtom-ORD"><mi class="MJX-tex-caligraphic" mathvariant="script">L</mi></mrow></math></span></span><script type="math/tex" id="MathJax-Element-74">\mathcal{L}</script></span> 进行对数化： <span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-75-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mtable columnalign=&quot;right left&quot; rowspacing=&quot;3pt&quot; columnspacing=&quot;0em&quot; displaystyle=&quot;true&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;log&lt;/mi&gt;&lt;mo&gt;&amp;#x2061;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi class=&quot;MJX-tex-caligraphic&quot; mathvariant=&quot;script&quot;&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo&gt;&amp;#x2211;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mi&gt;log&lt;/mi&gt;&lt;mo&gt;&amp;#x2061;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mrow&gt;&lt;msqrt&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;&amp;#x03C0;&lt;/mi&gt;&lt;/msqrt&gt;&lt;mi&gt;&amp;#x03C3;&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;msup&gt;&lt;mi&gt;e&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03C3;&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd /&gt;&lt;mtd&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo&gt;&amp;#x2211;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;log&lt;/mi&gt;&lt;mo&gt;&amp;#x2061;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mrow&gt;&lt;msqrt&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;&amp;#x03C0;&lt;/mi&gt;&lt;/msqrt&gt;&lt;mi&gt;&amp;#x03C3;&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;log&lt;/mi&gt;&lt;mo&gt;&amp;#x2061;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;msup&gt;&lt;mi&gt;e&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03C3;&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd /&gt;&lt;mtd&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mi&gt;log&lt;/mi&gt;&lt;mo&gt;&amp;#x2061;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mrow&gt;&lt;msqrt&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;&amp;#x03C0;&lt;/mi&gt;&lt;/msqrt&gt;&lt;mi&gt;&amp;#x03C3;&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;munderover&gt;&lt;mo&gt;&amp;#x2211;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03C3;&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd /&gt;&lt;mtd&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mi&gt;o&lt;/mi&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mi&gt;s&lt;/mi&gt;&lt;mi&gt;t&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03C3;&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mfrac&gt;&lt;mo&gt;&amp;#x22C5;&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;&lt;munderover&gt;&lt;mo&gt;&amp;#x2211;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1013" style="width: 21.21em; display: inline-block;"><span style="display: inline-block; position: relative; width: 18.109em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(-4.412em, 1017.76em, 8.399em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-1014"><span class="mtable" id="MathJax-Span-1015" style="padding-right: 0.167em; padding-left: 0.167em;"><span style="display: inline-block; position: relative; width: 17.798em; height: 0px;"><span style="position: absolute; clip: rect(5.598em, 1002.12em, 16.223em, -1000em); top: -11.325em; left: 0em;"><span style="display: inline-block; position: relative; width: 2.159em; height: 0px;"><span style="position: absolute; clip: rect(3.163em, 1002.12em, 4.385em, -1000em); top: -8.89em; right: 0em;"><span class="mtd" id="MathJax-Span-1016"><span class="mrow" id="MathJax-Span-1017"><span class="mi" id="MathJax-Span-1018" style="font-family: STIXGeneral;">log</span><span class="mo" id="MathJax-Span-1019"></span><span class="texatom" id="MathJax-Span-1020" style="padding-left: 0.188em;"><span class="mrow" id="MathJax-Span-1021"><span class="texatom" id="MathJax-Span-1022"><span class="mrow" id="MathJax-Span-1023"><span class="mi" id="MathJax-Span-1024" style="font-family: STIXNonUnicode; font-style: italic;"></span></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.846em, 1000em, 4.167em, -1000em); top: -5.683em; right: 0em;"><span class="mtd" id="MathJax-Span-1088"><span class="mrow" id="MathJax-Span-1089"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.846em, 1000em, 4.167em, -1000em); top: -2.476em; right: 0em;"><span class="mtd" id="MathJax-Span-1162"><span class="mrow" id="MathJax-Span-1163"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.846em, 1000em, 4.167em, -1000em); top: 0.731em; right: 0em;"><span class="mtd" id="MathJax-Span-1224"><span class="mrow" id="MathJax-Span-1225"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 11.325em;"></span></span><span style="position: absolute; clip: rect(6.859em, 1015.46em, 19.671em, -1000em); top: -13.515em; left: 2.159em;"><span style="display: inline-block; position: relative; width: 15.639em; height: 0px;"><span style="position: absolute; clip: rect(2.234em, 1011.49em, 5.424em, -1000em); top: -8.89em; left: 0em;"><span class="mtd" id="MathJax-Span-1025"><span class="mrow" id="MathJax-Span-1026"><span class="mi" id="MathJax-Span-1027"></span><span class="mo" id="MathJax-Span-1028" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="munderover" id="MathJax-Span-1029" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 1.292em; height: 0px;"><span style="position: absolute; clip: rect(2.871em, 1001.2em, 4.642em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1030" style="font-family: STIXSizeOneSym; vertical-align: -0.524em;">∑</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.96em, 4.274em, -1000em); top: -2.856em; left: 0.129em;"><span class="texatom" id="MathJax-Span-1031"><span class="mrow" id="MathJax-Span-1032"><span class="mi" id="MathJax-Span-1033" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1034" style="font-size: 70.7%; font-family: STIXGeneral;">=</span><span class="mn" id="MathJax-Span-1035" style="font-size: 70.7%; font-family: STIXGeneral;">1</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.434em, 1000.5em, 4.173em, -1000em); top: -5.206em; left: 0.391em;"><span class="texatom" id="MathJax-Span-1036"><span class="mrow" id="MathJax-Span-1037"><span class="mi" id="MathJax-Span-1038" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1039" style="font-family: STIXGeneral; padding-left: 0.188em;">log</span><span class="mo" id="MathJax-Span-1040"></span><span class="texatom" id="MathJax-Span-1041" style="padding-left: 0.188em;"><span class="mrow" id="MathJax-Span-1042"><span class="mfrac" id="MathJax-Span-1043"><span style="display: inline-block; position: relative; width: 2.449em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.17em, 1000.39em, 4.167em, -1000em); top: -4.683em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1044" style="font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.03em, 1002.33em, 4.305em, -1000em); top: -3.217em; left: 50%; margin-left: -1.165em;"><span class="mrow" id="MathJax-Span-1045"><span class="msqrt" id="MathJax-Span-1046"><span style="display: inline-block; position: relative; width: 1.798em; height: 0px;"><span style="position: absolute; clip: rect(3.17em, 1001.04em, 4.185em, -1000em); top: -4.006em; left: 0.737em;"><span class="mrow" id="MathJax-Span-1047"><span class="mn" id="MathJax-Span-1048" style="font-family: STIXGeneral;">2</span><span class="mi" id="MathJax-Span-1049" style="font-family: STIXGeneral; font-style: italic;">π<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.032em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.026em, 1001.06em, 3.397em, -1000em); top: -4.002em; left: 0.737em;"><span style="display: inline-block; position: relative; width: 1.061em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral; top: -4.006em; left: 0em;">‾<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; font-family: STIXGeneral; top: -4.006em; left: 0.561em;">‾<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXGeneral; position: absolute; top: -4.006em; left: 0.268em;">‾<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.903em, 1000.77em, 4.178em, -1000em); top: -3.879em; left: 0em;"><span style="font-family: STIXVariants;">√</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1050" style="font-family: STIXGeneral; font-style: italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.033em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1002.45em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 2.449em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1051"><span style="display: inline-block; position: relative; width: 4.542em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.41em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1052" style="font-family: STIXGeneral; font-style: italic;">e</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.585em; left: 0.444em;"><span class="texatom" id="MathJax-Span-1053"><span class="mrow" id="MathJax-Span-1054"><span class="mo" id="MathJax-Span-1055" style="font-size: 70.7%; font-family: STIXGeneral;">−</span><span class="mfrac" id="MathJax-Span-1056"><span style="display: inline-block; position: relative; width: 3.299em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.327em, 1003.18em, 4.339em, -1000em); top: -4.516em; left: 50%; margin-left: -1.589em;"><span class="mrow" id="MathJax-Span-1057"><span class="mo" id="MathJax-Span-1058" style="font-size: 50%; font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1059"><span style="display: inline-block; position: relative; width: 0.732em; height: 0px;"><span style="position: absolute; clip: rect(3.626em, 1000.21em, 4.27em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1060" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.188em; left: 0.222em;"><span class="texatom" id="MathJax-Span-1061"><span class="mrow" id="MathJax-Span-1062"><span class="mo" id="MathJax-Span-1063" style="font-size: 50%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1064" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1065" style="font-size: 50%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1066" style="font-size: 50%; font-family: STIXGeneral;">−</span><span class="msubsup" id="MathJax-Span-1067"><span style="display: inline-block; position: relative; width: 0.535em; height: 0px;"><span style="position: absolute; clip: rect(3.505em, 1000.24em, 4.171em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1068" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">h</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.84em; left: 0.25em;"><span class="texatom" id="MathJax-Span-1069"><span class="mrow" id="MathJax-Span-1070"><span class="mi" id="MathJax-Span-1071" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.007em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1072" style="font-size: 50%; font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1073"><span style="display: inline-block; position: relative; width: 0.783em; height: 0px;"><span style="position: absolute; clip: rect(3.626em, 1000.22em, 4.172em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1074" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.188em; left: 0.274em;"><span class="texatom" id="MathJax-Span-1075"><span class="mrow" id="MathJax-Span-1076"><span class="mo" id="MathJax-Span-1077" style="font-size: 50%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1078" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1079" style="font-size: 50%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1080"><span style="display: inline-block; position: relative; width: 0.454em; height: 0px;"><span style="position: absolute; clip: rect(3.508em, 1000.14em, 4.255em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1081" style="font-size: 50%; font-family: STIXGeneral;">)</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.188em; left: 0.167em;"><span class="mn" id="MathJax-Span-1082" style="font-size: 50%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.364em, 1000.86em, 4.172em, -1000em); top: -3.541em; left: 50%; margin-left: -0.429em;"><span class="mrow" id="MathJax-Span-1083"><span class="mn" id="MathJax-Span-1084" style="font-size: 50%; font-family: STIXGeneral;">2</span><span class="msubsup" id="MathJax-Span-1085"><span style="display: inline-block; position: relative; width: 0.608em; height: 0px;"><span style="position: absolute; clip: rect(3.632em, 1000.27em, 4.172em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1086" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.017em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.151em; left: 0.32em;"><span class="mn" id="MathJax-Span-1087" style="font-size: 50%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1003.3em, 1.229em, -1000em); top: -1.215em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 3.299em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.234em, 1015.46em, 5.424em, -1000em); top: -5.683em; left: 0em;"><span class="mtd" id="MathJax-Span-1090"><span class="mrow" id="MathJax-Span-1091"><span class="mi" id="MathJax-Span-1092"></span><span class="mo" id="MathJax-Span-1093" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="munderover" id="MathJax-Span-1094" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 1.292em; height: 0px;"><span style="position: absolute; clip: rect(2.871em, 1001.2em, 4.642em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1095" style="font-family: STIXSizeOneSym; vertical-align: -0.524em;">∑</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.96em, 4.274em, -1000em); top: -2.856em; left: 0.129em;"><span class="texatom" id="MathJax-Span-1096"><span class="mrow" id="MathJax-Span-1097"><span class="mi" id="MathJax-Span-1098" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1099" style="font-size: 70.7%; font-family: STIXGeneral;">=</span><span class="mn" id="MathJax-Span-1100" style="font-size: 70.7%; font-family: STIXGeneral;">1</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.434em, 1000.5em, 4.173em, -1000em); top: -5.206em; left: 0.391em;"><span class="texatom" id="MathJax-Span-1101"><span class="mrow" id="MathJax-Span-1102"><span class="mi" id="MathJax-Span-1103" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mrow" id="MathJax-Span-1104" style="padding-left: 0.188em;"><span class="mo" id="MathJax-Span-1105" style="vertical-align: -0.586em;"><span style="font-family: STIXSizeThreeSym;">(</span></span><span class="mrow" id="MathJax-Span-1106"><span class="mi" id="MathJax-Span-1107" style="font-family: STIXGeneral;">log</span><span class="mo" id="MathJax-Span-1108"></span><span class="texatom" id="MathJax-Span-1109" style="padding-left: 0.188em;"><span class="mrow" id="MathJax-Span-1110"><span class="mfrac" id="MathJax-Span-1111"><span style="display: inline-block; position: relative; width: 2.449em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.17em, 1000.39em, 4.167em, -1000em); top: -4.683em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1112" style="font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.03em, 1002.33em, 4.305em, -1000em); top: -3.217em; left: 50%; margin-left: -1.165em;"><span class="mrow" id="MathJax-Span-1113"><span class="msqrt" id="MathJax-Span-1114"><span style="display: inline-block; position: relative; width: 1.798em; height: 0px;"><span style="position: absolute; clip: rect(3.17em, 1001.04em, 4.185em, -1000em); top: -4.006em; left: 0.737em;"><span class="mrow" id="MathJax-Span-1115"><span class="mn" id="MathJax-Span-1116" style="font-family: STIXGeneral;">2</span><span class="mi" id="MathJax-Span-1117" style="font-family: STIXGeneral; font-style: italic;">π<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.032em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.026em, 1001.06em, 3.397em, -1000em); top: -4.002em; left: 0.737em;"><span style="display: inline-block; position: relative; width: 1.061em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral; top: -4.006em; left: 0em;">‾<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; font-family: STIXGeneral; top: -4.006em; left: 0.561em;">‾<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXGeneral; position: absolute; top: -4.006em; left: 0.268em;">‾<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.903em, 1000.77em, 4.178em, -1000em); top: -3.879em; left: 0em;"><span style="font-family: STIXVariants;">√</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1118" style="font-family: STIXGeneral; font-style: italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.033em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1002.45em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 2.449em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="mo" id="MathJax-Span-1119" style="font-family: STIXGeneral; padding-left: 0.25em;">+</span><span class="mi" id="MathJax-Span-1120" style="font-family: STIXGeneral; padding-left: 0.25em;">log</span><span class="mo" id="MathJax-Span-1121"></span><span class="texatom" id="MathJax-Span-1122" style="padding-left: 0.188em;"><span class="mrow" id="MathJax-Span-1123"><span class="msubsup" id="MathJax-Span-1124"><span style="display: inline-block; position: relative; width: 4.542em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.41em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1125" style="font-family: STIXGeneral; font-style: italic;">e</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.585em; left: 0.444em;"><span class="texatom" id="MathJax-Span-1126"><span class="mrow" id="MathJax-Span-1127"><span class="mo" id="MathJax-Span-1128" style="font-size: 70.7%; font-family: STIXGeneral;">−</span><span class="mfrac" id="MathJax-Span-1129"><span style="display: inline-block; position: relative; width: 3.299em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.327em, 1003.18em, 4.339em, -1000em); top: -4.516em; left: 50%; margin-left: -1.589em;"><span class="mrow" id="MathJax-Span-1130"><span class="mo" id="MathJax-Span-1131" style="font-size: 50%; font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1132"><span style="display: inline-block; position: relative; width: 0.732em; height: 0px;"><span style="position: absolute; clip: rect(3.626em, 1000.21em, 4.27em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1133" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.188em; left: 0.222em;"><span class="texatom" id="MathJax-Span-1134"><span class="mrow" id="MathJax-Span-1135"><span class="mo" id="MathJax-Span-1136" style="font-size: 50%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1137" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1138" style="font-size: 50%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1139" style="font-size: 50%; font-family: STIXGeneral;">−</span><span class="msubsup" id="MathJax-Span-1140"><span style="display: inline-block; position: relative; width: 0.535em; height: 0px;"><span style="position: absolute; clip: rect(3.505em, 1000.24em, 4.171em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1141" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">h</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.84em; left: 0.25em;"><span class="texatom" id="MathJax-Span-1142"><span class="mrow" id="MathJax-Span-1143"><span class="mi" id="MathJax-Span-1144" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.007em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1145" style="font-size: 50%; font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1146"><span style="display: inline-block; position: relative; width: 0.783em; height: 0px;"><span style="position: absolute; clip: rect(3.626em, 1000.22em, 4.172em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1147" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.188em; left: 0.274em;"><span class="texatom" id="MathJax-Span-1148"><span class="mrow" id="MathJax-Span-1149"><span class="mo" id="MathJax-Span-1150" style="font-size: 50%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1151" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1152" style="font-size: 50%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1153"><span style="display: inline-block; position: relative; width: 0.454em; height: 0px;"><span style="position: absolute; clip: rect(3.508em, 1000.14em, 4.255em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1154" style="font-size: 50%; font-family: STIXGeneral;">)</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.188em; left: 0.167em;"><span class="mn" id="MathJax-Span-1155" style="font-size: 50%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.364em, 1000.86em, 4.172em, -1000em); top: -3.541em; left: 50%; margin-left: -0.429em;"><span class="mrow" id="MathJax-Span-1156"><span class="mn" id="MathJax-Span-1157" style="font-size: 50%; font-family: STIXGeneral;">2</span><span class="msubsup" id="MathJax-Span-1158"><span style="display: inline-block; position: relative; width: 0.608em; height: 0px;"><span style="position: absolute; clip: rect(3.632em, 1000.27em, 4.172em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1159" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.017em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.151em; left: 0.32em;"><span class="mn" id="MathJax-Span-1160" style="font-size: 50%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1003.3em, 1.229em, -1000em); top: -1.215em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 3.299em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span></span></span></span></span><span class="mo" id="MathJax-Span-1161" style="vertical-align: -0.586em;"><span style="font-family: STIXSizeThreeSym;">)</span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.234em, 1015.37em, 5.424em, -1000em); top: -2.476em; left: 0em;"><span class="mtd" id="MathJax-Span-1164"><span class="mrow" id="MathJax-Span-1165"><span class="mi" id="MathJax-Span-1166"></span><span class="mo" id="MathJax-Span-1167" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mi" id="MathJax-Span-1168" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.313em;">m</span><span class="mi" id="MathJax-Span-1169" style="font-family: STIXGeneral; padding-left: 0.188em;">log</span><span class="mo" id="MathJax-Span-1170"></span><span class="texatom" id="MathJax-Span-1171" style="padding-left: 0.188em;"><span class="mrow" id="MathJax-Span-1172"><span class="mfrac" id="MathJax-Span-1173"><span style="display: inline-block; position: relative; width: 2.449em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.17em, 1000.39em, 4.167em, -1000em); top: -4.683em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1174" style="font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.03em, 1002.33em, 4.305em, -1000em); top: -3.217em; left: 50%; margin-left: -1.165em;"><span class="mrow" id="MathJax-Span-1175"><span class="msqrt" id="MathJax-Span-1176"><span style="display: inline-block; position: relative; width: 1.798em; height: 0px;"><span style="position: absolute; clip: rect(3.17em, 1001.04em, 4.185em, -1000em); top: -4.006em; left: 0.737em;"><span class="mrow" id="MathJax-Span-1177"><span class="mn" id="MathJax-Span-1178" style="font-family: STIXGeneral;">2</span><span class="mi" id="MathJax-Span-1179" style="font-family: STIXGeneral; font-style: italic;">π<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.032em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.026em, 1001.06em, 3.397em, -1000em); top: -4.002em; left: 0.737em;"><span style="display: inline-block; position: relative; width: 1.061em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral; top: -4.006em; left: 0em;">‾<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; font-family: STIXGeneral; top: -4.006em; left: 0.561em;">‾<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="font-family: STIXGeneral; position: absolute; top: -4.006em; left: 0.268em;">‾<span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.903em, 1000.77em, 4.178em, -1000em); top: -3.879em; left: 0em;"><span style="font-family: STIXVariants;">√</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1180" style="font-family: STIXGeneral; font-style: italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.033em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1002.45em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 2.449em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span></span></span><span class="mo" id="MathJax-Span-1181" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="munderover" id="MathJax-Span-1182" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 1.292em; height: 0px;"><span style="position: absolute; clip: rect(2.871em, 1001.2em, 4.642em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1183" style="font-family: STIXSizeOneSym; vertical-align: -0.524em;">∑</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.96em, 4.274em, -1000em); top: -2.856em; left: 0.129em;"><span class="texatom" id="MathJax-Span-1184"><span class="mrow" id="MathJax-Span-1185"><span class="mi" id="MathJax-Span-1186" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1187" style="font-size: 70.7%; font-family: STIXGeneral;">=</span><span class="mn" id="MathJax-Span-1188" style="font-size: 70.7%; font-family: STIXGeneral;">1</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.434em, 1000.5em, 4.173em, -1000em); top: -5.206em; left: 0.391em;"><span class="texatom" id="MathJax-Span-1189"><span class="mrow" id="MathJax-Span-1190"><span class="mi" id="MathJax-Span-1191" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mfrac" id="MathJax-Span-1192" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 6.084em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.005em, 1005.96em, 4.373em, -1000em); top: -4.686em; left: 50%; margin-left: -2.982em;"><span class="mrow" id="MathJax-Span-1193"><span class="mo" id="MathJax-Span-1194" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1195"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1196" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.444em;"><span class="texatom" id="MathJax-Span-1197"><span class="mrow" id="MathJax-Span-1198"><span class="mo" id="MathJax-Span-1199" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1200" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1201" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1202" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-1203" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 0.924em; height: 0px;"><span style="position: absolute; clip: rect(3.163em, 1000.48em, 4.176em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1204" style="font-family: STIXGeneral; font-style: italic;">h</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.5em;"><span class="texatom" id="MathJax-Span-1205"><span class="mrow" id="MathJax-Span-1206"><span class="mi" id="MathJax-Span-1207" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1208" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1209"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1210" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.498em;"><span class="texatom" id="MathJax-Span-1211"><span class="mrow" id="MathJax-Span-1212"><span class="mo" id="MathJax-Span-1213" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1214" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1215" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1216"><span style="display: inline-block; position: relative; width: 0.762em; height: 0px;"><span style="position: absolute; clip: rect(3.17em, 1000.29em, 4.344em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1217" style="font-family: STIXGeneral;">)</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.333em;"><span class="mn" id="MathJax-Span-1218" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.079em, 1001.52em, 4.178em, -1000em); top: -3.266em; left: 50%; margin-left: -0.76em;"><span class="mrow" id="MathJax-Span-1219"><span class="mn" id="MathJax-Span-1220" style="font-family: STIXGeneral;">2</span><span class="msubsup" id="MathJax-Span-1221"><span style="display: inline-block; position: relative; width: 1.019em; height: 0px;"><span style="position: absolute; clip: rect(3.418em, 1000.53em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1222" style="font-family: STIXGeneral; font-style: italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.033em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.295em; left: 0.591em;"><span class="mn" id="MathJax-Span-1223" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1006.08em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 6.084em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.234em, 1014.91em, 5.424em, -1000em); top: 0.731em; left: 0em;"><span class="mtd" id="MathJax-Span-1226"><span class="mrow" id="MathJax-Span-1227"><span class="mi" id="MathJax-Span-1228"></span><span class="mo" id="MathJax-Span-1229" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mi" id="MathJax-Span-1230" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.313em;">c</span><span class="mi" id="MathJax-Span-1231" style="font-family: STIXGeneral; font-style: italic;">o</span><span class="mi" id="MathJax-Span-1232" style="font-family: STIXGeneral; font-style: italic;">n</span><span class="mi" id="MathJax-Span-1233" style="font-family: STIXGeneral; font-style: italic;">s</span><span class="mi" id="MathJax-Span-1234" style="font-family: STIXGeneral; font-style: italic;">t<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.018em;"></span></span><span class="mo" id="MathJax-Span-1235" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="mfrac" id="MathJax-Span-1236" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 1.139em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.17em, 1000.39em, 4.167em, -1000em); top: -4.683em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1237" style="font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.079em, 1001.02em, 4.178em, -1000em); top: -3.266em; left: 50%; margin-left: -0.51em;"><span class="msubsup" id="MathJax-Span-1238"><span style="display: inline-block; position: relative; width: 1.019em; height: 0px;"><span style="position: absolute; clip: rect(3.418em, 1000.53em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1239" style="font-family: STIXGeneral; font-style: italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.033em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.295em; left: 0.591em;"><span class="mn" id="MathJax-Span-1240" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1001.14em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 1.139em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="mo" id="MathJax-Span-1241" style="font-family: STIXGeneral; padding-left: 0.25em;">⋅</span><span class="mfrac" id="MathJax-Span-1242" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 0.62em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.17em, 1000.39em, 4.167em, -1000em); top: -4.683em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1243" style="font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.17em, 1000.47em, 4.167em, -1000em); top: -3.32em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1244" style="font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1000.62em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 0.62em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="munderover" id="MathJax-Span-1245" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 1.292em; height: 0px;"><span style="position: absolute; clip: rect(2.871em, 1001.2em, 4.642em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1246" style="font-family: STIXSizeOneSym; vertical-align: -0.524em;">∑</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.96em, 4.274em, -1000em); top: -2.856em; left: 0.129em;"><span class="texatom" id="MathJax-Span-1247"><span class="mrow" id="MathJax-Span-1248"><span class="mi" id="MathJax-Span-1249" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1250" style="font-size: 70.7%; font-family: STIXGeneral;">=</span><span class="mn" id="MathJax-Span-1251" style="font-size: 70.7%; font-family: STIXGeneral;">1</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.434em, 1000.5em, 4.173em, -1000em); top: -5.206em; left: 0.391em;"><span class="texatom" id="MathJax-Span-1252"><span class="mrow" id="MathJax-Span-1253"><span class="mi" id="MathJax-Span-1254" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1255" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1256"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1257" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.444em;"><span class="texatom" id="MathJax-Span-1258"><span class="mrow" id="MathJax-Span-1259"><span class="mo" id="MathJax-Span-1260" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1261" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1262" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1263" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-1264" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 1.071em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1265" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.548em;"><span class="mi" id="MathJax-Span-1266" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1267"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1268" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.498em;"><span class="texatom" id="MathJax-Span-1269"><span class="mrow" id="MathJax-Span-1270"><span class="mo" id="MathJax-Span-1271" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1272" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1273" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1274"><span style="display: inline-block; position: relative; width: 0.762em; height: 0px;"><span style="position: absolute; clip: rect(3.17em, 1000.29em, 4.344em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1275" style="font-family: STIXGeneral;">)</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.333em;"><span class="mn" id="MathJax-Span-1276" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 13.515em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -7.077em; border-left: 0px solid; width: 0px; height: 14.739em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mtable columnalign="right left" rowspacing="3pt" columnspacing="0em" displaystyle="true"><mtr><mtd><mi>log</mi><mo>⁡</mo><mrow class="MJX-TeXAtom-ORD"><mrow class="MJX-TeXAtom-ORD"><mi class="MJX-tex-caligraphic" mathvariant="script">L</mi></mrow></mrow></mtd><mtd><mi></mi><mo>=</mo><munderover><mo>∑</mo><mrow class="MJX-TeXAtom-ORD"><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow class="MJX-TeXAtom-ORD"><mi>m</mi></mrow></munderover><mi>log</mi><mo>⁡</mo><mrow class="MJX-TeXAtom-ORD"><mfrac><mn>1</mn><mrow><msqrt><mn>2</mn><mi>π</mi></msqrt><mi>σ</mi></mrow></mfrac><msup><mi>e</mi><mrow class="MJX-TeXAtom-ORD"><mo>−</mo><mfrac><mrow><mo stretchy="false">(</mo><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>−</mo><msub><mi>h</mi><mrow class="MJX-TeXAtom-ORD"><mi>θ</mi></mrow></msub><mo stretchy="false">(</mo><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><msup><mo stretchy="false">)</mo><mn>2</mn></msup></mrow><mrow><mn>2</mn><msup><mi>σ</mi><mn>2</mn></msup></mrow></mfrac></mrow></msup></mrow></mtd></mtr><mtr><mtd></mtd><mtd><mi></mi><mo>=</mo><munderover><mo>∑</mo><mrow class="MJX-TeXAtom-ORD"><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow class="MJX-TeXAtom-ORD"><mi>m</mi></mrow></munderover><mrow><mo>(</mo><mrow><mi>log</mi><mo>⁡</mo><mrow class="MJX-TeXAtom-ORD"><mfrac><mn>1</mn><mrow><msqrt><mn>2</mn><mi>π</mi></msqrt><mi>σ</mi></mrow></mfrac><mo>+</mo><mi>log</mi><mo>⁡</mo><mrow class="MJX-TeXAtom-ORD"><msup><mi>e</mi><mrow class="MJX-TeXAtom-ORD"><mo>−</mo><mfrac><mrow><mo stretchy="false">(</mo><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>−</mo><msub><mi>h</mi><mrow class="MJX-TeXAtom-ORD"><mi>θ</mi></mrow></msub><mo stretchy="false">(</mo><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><msup><mo stretchy="false">)</mo><mn>2</mn></msup></mrow><mrow><mn>2</mn><msup><mi>σ</mi><mn>2</mn></msup></mrow></mfrac></mrow></msup></mrow></mrow></mrow><mo>)</mo></mrow></mtd></mtr><mtr><mtd></mtd><mtd><mi></mi><mo>=</mo><mi>m</mi><mi>log</mi><mo>⁡</mo><mrow class="MJX-TeXAtom-ORD"><mfrac><mn>1</mn><mrow><msqrt><mn>2</mn><mi>π</mi></msqrt><mi>σ</mi></mrow></mfrac></mrow><mo>−</mo><munderover><mo>∑</mo><mrow class="MJX-TeXAtom-ORD"><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow class="MJX-TeXAtom-ORD"><mi>m</mi></mrow></munderover><mfrac><mrow><mo stretchy="false">(</mo><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>−</mo><msub><mi>h</mi><mrow class="MJX-TeXAtom-ORD"><mi>θ</mi></mrow></msub><mo stretchy="false">(</mo><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><msup><mo stretchy="false">)</mo><mn>2</mn></msup></mrow><mrow><mn>2</mn><msup><mi>σ</mi><mn>2</mn></msup></mrow></mfrac></mtd></mtr><mtr><mtd></mtd><mtd><mi></mi><mo>=</mo><mi>c</mi><mi>o</mi><mi>n</mi><mi>s</mi><mi>t</mi><mo>−</mo><mfrac><mn>1</mn><msup><mi>σ</mi><mn>2</mn></msup></mfrac><mo>⋅</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><munderover><mo>∑</mo><mrow class="MJX-TeXAtom-ORD"><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow class="MJX-TeXAtom-ORD"><mi>m</mi></mrow></munderover><mo stretchy="false">(</mo><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>−</mo><msup><mi>θ</mi><mi>T</mi></msup><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><msup><mo stretchy="false">)</mo><mn>2</mn></msup></mtd></mtr></mtable></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-75">
\begin{split}
\log{\mathcal{L}}&=\sum_{i=1}^{m}\log{\frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{(y^{(i)}-h_{\theta}(x^{(i)})^2}{2\sigma^2}}}\\
&=\sum_{i=1}^{m}\left(\log{\frac{1}{\sqrt{2\pi}\sigma}+\log{e^{-\frac{(y^{(i)}-h_{\theta}(x^{(i)})^2}{2\sigma^2}}}}\right)\\
&=m\log{\frac{1}{\sqrt{2\pi}\sigma}}-\sum_{i=1}^{m}\frac{(y^{(i)}-h_{\theta}(x^{(i)})^2}{2\sigma^2}\\
&=const-\frac{1}{\sigma^2}\cdot\frac{1}{2}\sum_{i=1}^{m}(y^{(i)}-\theta^Tx^{(i)})^2
\end{split}
</script></span> 最大化似然函数 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-76-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi class=&quot;MJX-tex-caligraphic&quot; mathvariant=&quot;script&quot;&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1277" style="width: 0.857em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.694em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(2.268em, 1000.65em, 3.266em, -1000em); top: -3.098em; left: 0em;"><span class="mrow" id="MathJax-Span-1278"><span class="texatom" id="MathJax-Span-1279"><span class="mrow" id="MathJax-Span-1280"><span class="mi" id="MathJax-Span-1281" style="font-family: STIXNonUnicode; font-style: italic;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 3.098em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.071em; border-left: 0px solid; width: 0px; height: 0.917em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow class="MJX-TeXAtom-ORD"><mi class="MJX-tex-caligraphic" mathvariant="script">L</mi></mrow></math></span></span><script type="math/tex" id="MathJax-Element-76">\mathcal{L}</script></span> 等价于最小化 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-77-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;&lt;munderover&gt;&lt;mo&gt;&amp;#x2211;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1282" style="width: 10.206em; display: inline-block;"><span style="display: inline-block; position: relative; width: 8.707em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.516em, 1008.71em, 3.113em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1283"><span class="mfrac" id="MathJax-Span-1284"><span style="display: inline-block; position: relative; width: 0.474em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.368em, 1000.28em, 4.167em, -1000em); top: -4.417em; left: 50%; margin-left: -0.177em;"><span class="mn" id="MathJax-Span-1285" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.34em, 4.167em, -1000em); top: -3.618em; left: 50%; margin-left: -0.177em;"><span class="mn" id="MathJax-Span-1286" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1000.47em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 0.474em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="munderover" id="MathJax-Span-1287" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 2.023em; height: 0px;"><span style="position: absolute; clip: rect(3.085em, 1000.86em, 4.428em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1288" style="font-family: STIXGeneral; vertical-align: -0.002em;">∑</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.534em, 1000.59em, 4.173em, -1000em); top: -4.494em; left: 0.914em;"><span class="texatom" id="MathJax-Span-1289"><span class="mrow" id="MathJax-Span-1290"><span class="mi" id="MathJax-Span-1291" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1001.11em, 4.174em, -1000em); top: -3.71em; left: 0.914em;"><span class="texatom" id="MathJax-Span-1292"><span class="mrow" id="MathJax-Span-1293"><span class="mi" id="MathJax-Span-1294" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1295" style="font-size: 70.7%; font-family: STIXGeneral;">=</span><span class="mn" id="MathJax-Span-1296" style="font-size: 70.7%; font-family: STIXGeneral;">1</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1297" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1298"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1299" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.444em;"><span class="texatom" id="MathJax-Span-1300"><span class="mrow" id="MathJax-Span-1301"><span class="mo" id="MathJax-Span-1302" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1303" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1304" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1305" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-1306" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 1.071em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1307" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.548em;"><span class="mi" id="MathJax-Span-1308" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1309"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1310" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.498em;"><span class="texatom" id="MathJax-Span-1311"><span class="mrow" id="MathJax-Span-1312"><span class="mo" id="MathJax-Span-1313" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1314" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1315" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1316"><span style="display: inline-block; position: relative; width: 0.762em; height: 0px;"><span style="position: absolute; clip: rect(3.17em, 1000.29em, 4.344em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1317" style="font-family: STIXGeneral;">)</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.333em;"><span class="mn" id="MathJax-Span-1318" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.517em; border-left: 0px solid; width: 0px; height: 1.618em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mn>1</mn><mn>2</mn></mfrac><munderover><mo>∑</mo><mrow class="MJX-TeXAtom-ORD"><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow class="MJX-TeXAtom-ORD"><mi>m</mi></mrow></munderover><mo stretchy="false">(</mo><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>−</mo><msup><mi>θ</mi><mi>T</mi></msup><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><msup><mo stretchy="false">)</mo><mn>2</mn></msup></math></span></span><script type="math/tex" id="MathJax-Element-77">\frac{1}{2}\sum_{i=1}^{m}(y^{(i)}-\theta^Tx^{(i)})^2</script></span> ,也等价于最小化 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-78-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;munderover&gt;&lt;mo&gt;&amp;#x2211;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1319" style="width: 10.793em; display: inline-block;"><span style="display: inline-block; position: relative; width: 9.188em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.516em, 1009.19em, 3.119em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1320"><span class="mfrac" id="MathJax-Span-1321"><span style="display: inline-block; position: relative; width: 0.984em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.368em, 1000.28em, 4.167em, -1000em); top: -4.417em; left: 50%; margin-left: -0.177em;"><span class="mn" id="MathJax-Span-1322" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.85em, 4.173em, -1000em); top: -3.618em; left: 50%; margin-left: -0.432em;"><span class="mrow" id="MathJax-Span-1323"><span class="mn" id="MathJax-Span-1324" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span class="mi" id="MathJax-Span-1325" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1000.98em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 0.984em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="munderover" id="MathJax-Span-1326" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 2.023em; height: 0px;"><span style="position: absolute; clip: rect(3.085em, 1000.86em, 4.428em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1327" style="font-family: STIXGeneral; vertical-align: -0.002em;">∑</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.534em, 1000.59em, 4.173em, -1000em); top: -4.494em; left: 0.914em;"><span class="texatom" id="MathJax-Span-1328"><span class="mrow" id="MathJax-Span-1329"><span class="mi" id="MathJax-Span-1330" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1001.11em, 4.174em, -1000em); top: -3.71em; left: 0.914em;"><span class="texatom" id="MathJax-Span-1331"><span class="mrow" id="MathJax-Span-1332"><span class="mi" id="MathJax-Span-1333" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1334" style="font-size: 70.7%; font-family: STIXGeneral;">=</span><span class="mn" id="MathJax-Span-1335" style="font-size: 70.7%; font-family: STIXGeneral;">1</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1336" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1337"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1338" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.444em;"><span class="texatom" id="MathJax-Span-1339"><span class="mrow" id="MathJax-Span-1340"><span class="mo" id="MathJax-Span-1341" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1342" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1343" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1344" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-1345" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 1.071em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1346" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.548em;"><span class="mi" id="MathJax-Span-1347" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1348"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1349" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.498em;"><span class="texatom" id="MathJax-Span-1350"><span class="mrow" id="MathJax-Span-1351"><span class="mo" id="MathJax-Span-1352" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1353" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1354" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1355"><span style="display: inline-block; position: relative; width: 0.762em; height: 0px;"><span style="position: absolute; clip: rect(3.17em, 1000.29em, 4.344em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1356" style="font-family: STIXGeneral;">)</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.333em;"><span class="mn" id="MathJax-Span-1357" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.524em; border-left: 0px solid; width: 0px; height: 1.626em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mn>1</mn><mrow><mn>2</mn><mi>m</mi></mrow></mfrac><munderover><mo>∑</mo><mrow class="MJX-TeXAtom-ORD"><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow class="MJX-TeXAtom-ORD"><mi>m</mi></mrow></munderover><mo stretchy="false">(</mo><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>−</mo><msup><mi>θ</mi><mi>T</mi></msup><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><msup><mo stretchy="false">)</mo><mn>2</mn></msup></math></span></span><script type="math/tex" id="MathJax-Element-78">\frac{1}{2m}\sum_{i=1}^{m}(y^{(i)}-\theta^Tx^{(i)})^2</script></span>，正是我们在上一节所说的损失函数。</p>
<blockquote>
<p>通过这一部分的推导，我们发现所谓的梯度下降使损失函数最小化的过程实质上是最大化似然函数的过程。</p>
</blockquote>
<h3 id="为什么梯度下降法能减小损失函数">为什么梯度下降法能减小损失函数</h3>
<p>考虑 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-79-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1358" style="width: 0.911em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.748em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.405em, 1000.75em, 2.7em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-1359"><span class="msubsup" id="MathJax-Span-1360"><span style="display: inline-block; position: relative; width: 0.752em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1361" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mi" id="MathJax-Span-1362" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.001em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.409em; border-left: 0px solid; width: 0px; height: 1.265em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>θ</mi><mi>j</mi></msub></math></span></span><script type="math/tex" id="MathJax-Element-79">\theta_j</script></span> 的迭代过程（变量只有一个），损失函数是一个存在极小值点的二次函数，用初中生都能听懂的话来说就是一条开口向上的抛物线：</p>
<div class="figure">
<a href="http://fangs.in/images/LinearRegression/cost.png" class="fancybox fancybox.image" rel="group"><img src="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/cost.png"></a>

</div>
<ol style="list-style-type: decimal">
<li>当起点在右侧时，<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-80-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2202;&lt;/mi&gt;&lt;mi&gt;J&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2202;&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;&amp;gt;&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1363" style="width: 3.582em; display: inline-block;"><span style="display: inline-block; position: relative; width: 3.045em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.509em, 1003.02em, 3.324em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1364"><span class="mfrac" id="MathJax-Span-1365"><span style="display: inline-block; position: relative; width: 0.985em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.374em, 1000.68em, 4.179em, -1000em); top: -4.429em; left: 50%; margin-left: -0.34em;"><span class="mrow" id="MathJax-Span-1366"><span class="mi" id="MathJax-Span-1367" style="font-size: 70.7%; font-family: STIXGeneral;">∂</span><span class="mi" id="MathJax-Span-1368" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.033em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.367em, 1000.87em, 4.376em, -1000em); top: -3.617em; left: 50%; margin-left: -0.432em;"><span class="mrow" id="MathJax-Span-1369"><span class="mi" id="MathJax-Span-1370" style="font-size: 70.7%; font-family: STIXGeneral;">∂</span><span class="msubsup" id="MathJax-Span-1371"><span style="display: inline-block; position: relative; width: 0.532em; height: 0px;"><span style="position: absolute; clip: rect(3.367em, 1000.35em, 4.174em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1372" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.9em; left: 0.339em;"><span class="mi" id="MathJax-Span-1373" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1000.99em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 0.985em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="mo" id="MathJax-Span-1374" style="font-family: STIXGeneral; padding-left: 0.313em;">&gt;</span><span class="mn" id="MathJax-Span-1375" style="font-family: STIXGeneral; padding-left: 0.313em;">0</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.763em; border-left: 0px solid; width: 0px; height: 1.873em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>J</mi></mrow><mrow><mi mathvariant="normal">∂</mi><msub><mi>θ</mi><mi>j</mi></msub></mrow></mfrac><mo>&gt;</mo><mn>0</mn></math></span></span><script type="math/tex" id="MathJax-Element-80">\frac{\partial J}{\partial \theta_j}>0</script></span>， 要损失函数降低就必须让 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-81-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1376" style="width: 0.911em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.748em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.405em, 1000.75em, 2.7em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-1377"><span class="msubsup" id="MathJax-Span-1378"><span style="display: inline-block; position: relative; width: 0.752em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1379" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mi" id="MathJax-Span-1380" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.001em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.409em; border-left: 0px solid; width: 0px; height: 1.265em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>θ</mi><mi>j</mi></msub></math></span></span><script type="math/tex" id="MathJax-Element-81">\theta_j</script></span>减小以接近极值点，此时<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-82-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msubsup&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mi&gt;e&lt;/mi&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;/mrow&gt;&lt;/msubsup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mi&gt;&amp;#x03B1;&lt;/mi&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2202;&lt;/mi&gt;&lt;mi&gt;J&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2202;&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;&amp;lt;&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1381" style="width: 10.419em; display: inline-block;"><span style="display: inline-block; position: relative; width: 8.868em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.509em, 1008.87em, 3.324em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1382"><span class="msubsup" id="MathJax-Span-1383"><span style="display: inline-block; position: relative; width: 1.762em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1384" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.534em, 1001.21em, 4.179em, -1000em); top: -4.364em; left: 0.548em;"><span class="texatom" id="MathJax-Span-1385"><span class="mrow" id="MathJax-Span-1386"><span class="mi" id="MathJax-Span-1387" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">n</span><span class="mi" id="MathJax-Span-1388" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">e</span><span class="mi" id="MathJax-Span-1389" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">w</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.385em, 1000.27em, 4.313em, -1000em); top: -3.71em; left: 0.48em;"><span class="mi" id="MathJax-Span-1390" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.001em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1391" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="msubsup" id="MathJax-Span-1392" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 0.752em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1393" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mi" id="MathJax-Span-1394" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.001em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1395" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="mi" id="MathJax-Span-1396" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.25em;">α</span><span class="mfrac" id="MathJax-Span-1397"><span style="display: inline-block; position: relative; width: 0.985em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.374em, 1000.68em, 4.179em, -1000em); top: -4.429em; left: 50%; margin-left: -0.34em;"><span class="mrow" id="MathJax-Span-1398"><span class="mi" id="MathJax-Span-1399" style="font-size: 70.7%; font-family: STIXGeneral;">∂</span><span class="mi" id="MathJax-Span-1400" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.033em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.367em, 1000.87em, 4.376em, -1000em); top: -3.617em; left: 50%; margin-left: -0.432em;"><span class="mrow" id="MathJax-Span-1401"><span class="mi" id="MathJax-Span-1402" style="font-size: 70.7%; font-family: STIXGeneral;">∂</span><span class="msubsup" id="MathJax-Span-1403"><span style="display: inline-block; position: relative; width: 0.532em; height: 0px;"><span style="position: absolute; clip: rect(3.367em, 1000.35em, 4.174em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1404" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.9em; left: 0.339em;"><span class="mi" id="MathJax-Span-1405" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1000.99em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 0.985em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="mo" id="MathJax-Span-1406" style="font-family: STIXGeneral; padding-left: 0.313em;">&lt;</span><span class="msubsup" id="MathJax-Span-1407" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 0.752em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1408" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mi" id="MathJax-Span-1409" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.001em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.763em; border-left: 0px solid; width: 0px; height: 1.873em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msubsup><mi>θ</mi><mi>j</mi><mrow class="MJX-TeXAtom-ORD"><mi>n</mi><mi>e</mi><mi>w</mi></mrow></msubsup><mo>=</mo><msub><mi>θ</mi><mi>j</mi></msub><mo>−</mo><mi>α</mi><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>J</mi></mrow><mrow><mi mathvariant="normal">∂</mi><msub><mi>θ</mi><mi>j</mi></msub></mrow></mfrac><mo>&lt;</mo><msub><mi>θ</mi><mi>j</mi></msub></math></span></span><script type="math/tex" id="MathJax-Element-82">\theta_j^{new} = \theta_j-\alpha\frac{\partial J}{\partial \theta_j}<\theta_j</script></span> ；</li>
<li>当起点在左侧时，<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-83-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2202;&lt;/mi&gt;&lt;mi&gt;J&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2202;&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;&amp;lt;&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1410" style="width: 3.582em; display: inline-block;"><span style="display: inline-block; position: relative; width: 3.045em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.509em, 1003.02em, 3.324em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1411"><span class="mfrac" id="MathJax-Span-1412"><span style="display: inline-block; position: relative; width: 0.985em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.374em, 1000.68em, 4.179em, -1000em); top: -4.429em; left: 50%; margin-left: -0.34em;"><span class="mrow" id="MathJax-Span-1413"><span class="mi" id="MathJax-Span-1414" style="font-size: 70.7%; font-family: STIXGeneral;">∂</span><span class="mi" id="MathJax-Span-1415" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.033em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.367em, 1000.87em, 4.376em, -1000em); top: -3.617em; left: 50%; margin-left: -0.432em;"><span class="mrow" id="MathJax-Span-1416"><span class="mi" id="MathJax-Span-1417" style="font-size: 70.7%; font-family: STIXGeneral;">∂</span><span class="msubsup" id="MathJax-Span-1418"><span style="display: inline-block; position: relative; width: 0.532em; height: 0px;"><span style="position: absolute; clip: rect(3.367em, 1000.35em, 4.174em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1419" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.9em; left: 0.339em;"><span class="mi" id="MathJax-Span-1420" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1000.99em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 0.985em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="mo" id="MathJax-Span-1421" style="font-family: STIXGeneral; padding-left: 0.313em;">&lt;</span><span class="mn" id="MathJax-Span-1422" style="font-family: STIXGeneral; padding-left: 0.313em;">0</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.763em; border-left: 0px solid; width: 0px; height: 1.873em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>J</mi></mrow><mrow><mi mathvariant="normal">∂</mi><msub><mi>θ</mi><mi>j</mi></msub></mrow></mfrac><mo>&lt;</mo><mn>0</mn></math></span></span><script type="math/tex" id="MathJax-Element-83">\frac{\partial J}{\partial \theta_j}<0</script></span>， 要损失函数降低就必须让 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-84-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1423" style="width: 0.911em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.748em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.405em, 1000.75em, 2.7em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-1424"><span class="msubsup" id="MathJax-Span-1425"><span style="display: inline-block; position: relative; width: 0.752em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1426" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mi" id="MathJax-Span-1427" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.001em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.409em; border-left: 0px solid; width: 0px; height: 1.265em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>θ</mi><mi>j</mi></msub></math></span></span><script type="math/tex" id="MathJax-Element-84">\theta_j</script></span>增大以接近极值点，此时<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-85-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msubsup&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mi&gt;e&lt;/mi&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;/mrow&gt;&lt;/msubsup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mi&gt;&amp;#x03B1;&lt;/mi&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2202;&lt;/mi&gt;&lt;mi&gt;J&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2202;&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;&amp;gt;&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1428" style="width: 10.419em; display: inline-block;"><span style="display: inline-block; position: relative; width: 8.868em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.509em, 1008.87em, 3.324em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1429"><span class="msubsup" id="MathJax-Span-1430"><span style="display: inline-block; position: relative; width: 1.762em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1431" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.534em, 1001.21em, 4.179em, -1000em); top: -4.364em; left: 0.548em;"><span class="texatom" id="MathJax-Span-1432"><span class="mrow" id="MathJax-Span-1433"><span class="mi" id="MathJax-Span-1434" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">n</span><span class="mi" id="MathJax-Span-1435" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">e</span><span class="mi" id="MathJax-Span-1436" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">w</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.385em, 1000.27em, 4.313em, -1000em); top: -3.71em; left: 0.48em;"><span class="mi" id="MathJax-Span-1437" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.001em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1438" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="msubsup" id="MathJax-Span-1439" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 0.752em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1440" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mi" id="MathJax-Span-1441" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.001em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1442" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="mi" id="MathJax-Span-1443" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.25em;">α</span><span class="mfrac" id="MathJax-Span-1444"><span style="display: inline-block; position: relative; width: 0.985em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.374em, 1000.68em, 4.179em, -1000em); top: -4.429em; left: 50%; margin-left: -0.34em;"><span class="mrow" id="MathJax-Span-1445"><span class="mi" id="MathJax-Span-1446" style="font-size: 70.7%; font-family: STIXGeneral;">∂</span><span class="mi" id="MathJax-Span-1447" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.033em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.367em, 1000.87em, 4.376em, -1000em); top: -3.617em; left: 50%; margin-left: -0.432em;"><span class="mrow" id="MathJax-Span-1448"><span class="mi" id="MathJax-Span-1449" style="font-size: 70.7%; font-family: STIXGeneral;">∂</span><span class="msubsup" id="MathJax-Span-1450"><span style="display: inline-block; position: relative; width: 0.532em; height: 0px;"><span style="position: absolute; clip: rect(3.367em, 1000.35em, 4.174em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1451" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.9em; left: 0.339em;"><span class="mi" id="MathJax-Span-1452" style="font-size: 50%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1000.99em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 0.985em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="mo" id="MathJax-Span-1453" style="font-family: STIXGeneral; padding-left: 0.313em;">&gt;</span><span class="msubsup" id="MathJax-Span-1454" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 0.752em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1455" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.48em;"><span class="mi" id="MathJax-Span-1456" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">j<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.001em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.763em; border-left: 0px solid; width: 0px; height: 1.873em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msubsup><mi>θ</mi><mi>j</mi><mrow class="MJX-TeXAtom-ORD"><mi>n</mi><mi>e</mi><mi>w</mi></mrow></msubsup><mo>=</mo><msub><mi>θ</mi><mi>j</mi></msub><mo>−</mo><mi>α</mi><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>J</mi></mrow><mrow><mi mathvariant="normal">∂</mi><msub><mi>θ</mi><mi>j</mi></msub></mrow></mfrac><mo>&gt;</mo><msub><mi>θ</mi><mi>j</mi></msub></math></span></span><script type="math/tex" id="MathJax-Element-85">\theta_j^{new} = \theta_j-\alpha\frac{\partial J}{\partial \theta_j}>\theta_j</script></span> ；</li>
</ol>
<p>综上，我们发现在梯度下降算法里，<strong>梯度的正负可以告知我们现在的点位于损失函数的哪一边</strong>，为我们确定下一步迭代的方向，增大还是减小；而迭代的幅度其实是由 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-86-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;&amp;#x03B1;&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1457" style="width: 0.644em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.534em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.963em, 1000.53em, 2.735em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1458"><span class="mi" id="MathJax-Span-1459" style="font-family: STIXGeneral; font-style: italic;">α</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.075em; border-left: 0px solid; width: 0px; height: 0.654em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>α</mi></math></span></span><script type="math/tex" id="MathJax-Element-86">\alpha</script></span> 控制的，<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-87-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;&amp;#x03B1;&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1460" style="width: 0.644em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.534em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.963em, 1000.53em, 2.735em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1461"><span class="mi" id="MathJax-Span-1462" style="font-family: STIXGeneral; font-style: italic;">α</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.075em; border-left: 0px solid; width: 0px; height: 0.654em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>α</mi></math></span></span><script type="math/tex" id="MathJax-Element-87">\alpha</script></span> 的值越小，算法收敛的可能性越高，而且结果越接近理论值，但是迭代的幅度相应也越小，<strong>高精度是以更多的迭代次数为代价的</strong>。</p>
<h3 id="正规方程-normal-equation">正规方程 Normal Equation</h3>
<p>除了用梯度下降法求解极值点以外，对于简单的现象问题还可以直接用线性方程求解，它的好处是无需迭代、不用担心 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-88-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;&amp;#x03B1;&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1463" style="width: 0.644em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.534em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.963em, 1000.53em, 2.735em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1464"><span class="mi" id="MathJax-Span-1465" style="font-family: STIXGeneral; font-style: italic;">α</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.075em; border-left: 0px solid; width: 0px; height: 0.654em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>α</mi></math></span></span><script type="math/tex" id="MathJax-Element-88">\alpha</script></span> 的大小问题，让我们回到损失函数先： <span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-89-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mi&gt;J&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;munderover&gt;&lt;mo&gt;&amp;#x2211;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1466" style="width: 14.479em; display: inline-block;"><span style="display: inline-block; position: relative; width: 12.34em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(0.792em, 1012.34em, 3.982em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1467"><span class="mi" id="MathJax-Span-1468" style="font-family: STIXGeneral; font-style: italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.047em;"></span></span><span class="mo" id="MathJax-Span-1469" style="font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1470" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1471" style="font-family: STIXGeneral;">)</span><span class="mo" id="MathJax-Span-1472" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mfrac" id="MathJax-Span-1473" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 1.342em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.17em, 1000.39em, 4.167em, -1000em); top: -4.683em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1474" style="font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.17em, 1001.2em, 4.176em, -1000em); top: -3.32em; left: 50%; margin-left: -0.611em;"><span class="mrow" id="MathJax-Span-1475"><span class="mn" id="MathJax-Span-1476" style="font-family: STIXGeneral;">2</span><span class="mi" id="MathJax-Span-1477" style="font-family: STIXGeneral; font-style: italic;">m</span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1001.34em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 1.342em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="munderover" id="MathJax-Span-1478" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 1.292em; height: 0px;"><span style="position: absolute; clip: rect(2.871em, 1001.2em, 4.642em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1479" style="font-family: STIXSizeOneSym; vertical-align: -0.524em;">∑</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.96em, 4.274em, -1000em); top: -2.856em; left: 0.129em;"><span class="texatom" id="MathJax-Span-1480"><span class="mrow" id="MathJax-Span-1481"><span class="mi" id="MathJax-Span-1482" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1483" style="font-size: 70.7%; font-family: STIXGeneral;">=</span><span class="mn" id="MathJax-Span-1484" style="font-size: 70.7%; font-family: STIXGeneral;">1</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.434em, 1000.5em, 4.173em, -1000em); top: -5.206em; left: 0.391em;"><span class="texatom" id="MathJax-Span-1485"><span class="mrow" id="MathJax-Span-1486"><span class="mi" id="MathJax-Span-1487" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1488" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1489"><span style="display: inline-block; position: relative; width: 0.924em; height: 0px;"><span style="position: absolute; clip: rect(3.163em, 1000.48em, 4.176em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1490" style="font-family: STIXGeneral; font-style: italic;">h</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.5em;"><span class="mi" id="MathJax-Span-1491" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1492" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1493"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1494" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.498em;"><span class="texatom" id="MathJax-Span-1495"><span class="mrow" id="MathJax-Span-1496"><span class="mo" id="MathJax-Span-1497" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1498" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1499" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1500" style="font-family: STIXGeneral;">)</span><span class="mo" id="MathJax-Span-1501" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-1502" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1503" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.444em;"><span class="texatom" id="MathJax-Span-1504"><span class="mrow" id="MathJax-Span-1505"><span class="mo" id="MathJax-Span-1506" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1507" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1508" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1509"><span style="display: inline-block; position: relative; width: 0.762em; height: 0px;"><span style="position: absolute; clip: rect(3.17em, 1000.29em, 4.344em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1510" style="font-family: STIXGeneral;">)</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.333em;"><span class="mn" id="MathJax-Span-1511" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -1.534em; border-left: 0px solid; width: 0px; height: 3.482em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mi>J</mi><mo stretchy="false">(</mo><mi>θ</mi><mo stretchy="false">)</mo><mo>=</mo><mfrac><mn>1</mn><mrow><mn>2</mn><mi>m</mi></mrow></mfrac><munderover><mo>∑</mo><mrow class="MJX-TeXAtom-ORD"><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow class="MJX-TeXAtom-ORD"><mi>m</mi></mrow></munderover><mo stretchy="false">(</mo><msub><mi>h</mi><mi>θ</mi></msub><mo stretchy="false">(</mo><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo stretchy="false">)</mo><mo>−</mo><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><msup><mo stretchy="false">)</mo><mn>2</mn></msup></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-89">
J(\theta)=\frac{1}{2m}\sum_{i=1}^{m} (h_\theta(x^{(i)})-y^{(i)})^2
</script></span></p>
<p>将上式写成矩阵的形式： ​ <span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-90-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mtable columnalign=&quot;right left&quot; rowspacing=&quot;3pt&quot; columnspacing=&quot;0em&quot; displaystyle=&quot;true&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;J&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;munderover&gt;&lt;mo&gt;&amp;#x2211;&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;&amp;#x22C5;&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd /&gt;&lt;mtd&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1512" style="width: 20.783em; display: inline-block;"><span style="display: inline-block; position: relative; width: 17.735em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(-0.794em, 1017.52em, 4.781em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-1513"><span class="mtable" id="MathJax-Span-1514" style="padding-right: 0.167em; padding-left: 0.167em;"><span style="display: inline-block; position: relative; width: 17.386em; height: 0px;"><span style="position: absolute; clip: rect(2.515em, 1000.49em, 6.437em, -1000em); top: -4.594em; left: 0em;"><span style="display: inline-block; position: relative; width: 0.491em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.49em, 4.185em, -1000em); top: -5.272em; right: 0em;"><span class="mtd" id="MathJax-Span-1515"><span class="mrow" id="MathJax-Span-1516"><span class="mi" id="MathJax-Span-1517" style="font-family: STIXGeneral; font-style: italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.047em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.846em, 1000em, 4.167em, -1000em); top: -2.324em; right: 0em;"><span class="mtd" id="MathJax-Span-1582"><span class="mrow" id="MathJax-Span-1583"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.594em;"></span></span><span style="position: absolute; clip: rect(3.212em, 1016.85em, 8.788em, -1000em); top: -6.25em; left: 0.491em;"><span style="display: inline-block; position: relative; width: 16.895em; height: 0px;"><span style="position: absolute; clip: rect(2.234em, 1016.85em, 5.424em, -1000em); top: -5.272em; left: 0em;"><span class="mtd" id="MathJax-Span-1518"><span class="mrow" id="MathJax-Span-1519"><span class="mi" id="MathJax-Span-1520"></span><span class="mo" id="MathJax-Span-1521" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mfrac" id="MathJax-Span-1522" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 1.342em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.17em, 1000.39em, 4.167em, -1000em); top: -4.683em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1523" style="font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.17em, 1001.2em, 4.176em, -1000em); top: -3.32em; left: 50%; margin-left: -0.611em;"><span class="mrow" id="MathJax-Span-1524"><span class="mn" id="MathJax-Span-1525" style="font-family: STIXGeneral;">2</span><span class="mi" id="MathJax-Span-1526" style="font-family: STIXGeneral; font-style: italic;">m</span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1001.34em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 1.342em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="munderover" id="MathJax-Span-1527" style="padding-left: 0.188em;"><span style="display: inline-block; position: relative; width: 1.292em; height: 0px;"><span style="position: absolute; clip: rect(2.871em, 1001.2em, 4.642em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1528" style="font-family: STIXSizeOneSym; vertical-align: -0.524em;">∑</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.96em, 4.274em, -1000em); top: -2.856em; left: 0.129em;"><span class="texatom" id="MathJax-Span-1529"><span class="mrow" id="MathJax-Span-1530"><span class="mi" id="MathJax-Span-1531" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1532" style="font-size: 70.7%; font-family: STIXGeneral;">=</span><span class="mn" id="MathJax-Span-1533" style="font-size: 70.7%; font-family: STIXGeneral;">1</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.434em, 1000.5em, 4.173em, -1000em); top: -5.206em; left: 0.391em;"><span class="texatom" id="MathJax-Span-1534"><span class="mrow" id="MathJax-Span-1535"><span class="mi" id="MathJax-Span-1536" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">m</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1537" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1538"><span style="display: inline-block; position: relative; width: 0.924em; height: 0px;"><span style="position: absolute; clip: rect(3.163em, 1000.48em, 4.176em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1539" style="font-family: STIXGeneral; font-style: italic;">h</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.5em;"><span class="mi" id="MathJax-Span-1540" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1541" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1542"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1543" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.498em;"><span class="texatom" id="MathJax-Span-1544"><span class="mrow" id="MathJax-Span-1545"><span class="mo" id="MathJax-Span-1546" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1547" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1548" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1549" style="font-family: STIXGeneral;">)</span><span class="mo" id="MathJax-Span-1550" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-1551" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1552" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.444em;"><span class="texatom" id="MathJax-Span-1553"><span class="mrow" id="MathJax-Span-1554"><span class="mo" id="MathJax-Span-1555" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1556" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1557" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1558" style="font-family: STIXGeneral;">)</span><span class="mo" id="MathJax-Span-1559" style="font-family: STIXGeneral; padding-left: 0.25em;">⋅</span><span class="mo" id="MathJax-Span-1560" style="font-family: STIXGeneral; padding-left: 0.25em;">(</span><span class="msubsup" id="MathJax-Span-1561"><span style="display: inline-block; position: relative; width: 0.924em; height: 0px;"><span style="position: absolute; clip: rect(3.163em, 1000.48em, 4.176em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1562" style="font-family: STIXGeneral; font-style: italic;">h</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.5em;"><span class="mi" id="MathJax-Span-1563" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1564" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1565"><span style="display: inline-block; position: relative; width: 1.24em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.45em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1566" style="font-family: STIXGeneral; font-style: italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.498em;"><span class="texatom" id="MathJax-Span-1567"><span class="mrow" id="MathJax-Span-1568"><span class="mo" id="MathJax-Span-1569" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1570" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1571" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1572" style="font-family: STIXGeneral;">)</span><span class="mo" id="MathJax-Span-1573" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-1574" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 1.187em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1575" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.444em;"><span class="texatom" id="MathJax-Span-1576"><span class="mrow" id="MathJax-Span-1577"><span class="mo" id="MathJax-Span-1578" style="font-size: 70.7%; font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1579" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-1580" style="font-size: 70.7%; font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1581" style="font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.494em, 1010.26em, 4.862em, -1000em); top: -2.324em; left: 0em;"><span class="mtd" id="MathJax-Span-1584"><span class="mrow" id="MathJax-Span-1585"><span class="mi" id="MathJax-Span-1586"></span><span class="mo" id="MathJax-Span-1587" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mfrac" id="MathJax-Span-1588" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 1.342em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.17em, 1000.39em, 4.167em, -1000em); top: -4.683em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1589" style="font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.17em, 1001.2em, 4.176em, -1000em); top: -3.32em; left: 50%; margin-left: -0.611em;"><span class="mrow" id="MathJax-Span-1590"><span class="mn" id="MathJax-Span-1591" style="font-family: STIXGeneral;">2</span><span class="mi" id="MathJax-Span-1592" style="font-family: STIXGeneral; font-style: italic;">m</span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1001.34em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 1.342em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="mo" id="MathJax-Span-1593" style="font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1594" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1595" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1596" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="mi" id="MathJax-Span-1597" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.25em;">y</span><span class="msubsup" id="MathJax-Span-1598"><span style="display: inline-block; position: relative; width: 0.856em; height: 0px;"><span style="position: absolute; clip: rect(3.17em, 1000.29em, 4.344em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1599" style="font-family: STIXGeneral;">)</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.333em;"><span class="mi" id="MathJax-Span-1600" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1601" style="font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1602" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1603" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1604" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="mi" id="MathJax-Span-1605" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.25em;">y</span><span class="mo" id="MathJax-Span-1606" style="font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 6.25em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -2.844em; border-left: 0px solid; width: 0px; height: 6.273em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mtable columnalign="right left" rowspacing="3pt" columnspacing="0em" displaystyle="true"><mtr><mtd><mi>J</mi></mtd><mtd><mi></mi><mo>=</mo><mfrac><mn>1</mn><mrow><mn>2</mn><mi>m</mi></mrow></mfrac><munderover><mo>∑</mo><mrow class="MJX-TeXAtom-ORD"><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow class="MJX-TeXAtom-ORD"><mi>m</mi></mrow></munderover><mo stretchy="false">(</mo><msub><mi>h</mi><mi>θ</mi></msub><mo stretchy="false">(</mo><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo stretchy="false">)</mo><mo>−</mo><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo stretchy="false">)</mo><mo>⋅</mo><mo stretchy="false">(</mo><msub><mi>h</mi><mi>θ</mi></msub><mo stretchy="false">(</mo><msup><mi>x</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo stretchy="false">)</mo><mo>−</mo><msup><mi>y</mi><mrow class="MJX-TeXAtom-ORD"><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo stretchy="false">)</mo></mtd></mtr><mtr><mtd></mtd><mtd><mi></mi><mo>=</mo><mfrac><mn>1</mn><mrow><mn>2</mn><mi>m</mi></mrow></mfrac><mo stretchy="false">(</mo><mi>X</mi><mi>θ</mi><mo>−</mo><mi>y</mi><msup><mo stretchy="false">)</mo><mi>T</mi></msup><mo stretchy="false">(</mo><mi>X</mi><mi>θ</mi><mo>−</mo><mi>y</mi><mo stretchy="false">)</mo></mtd></mtr></mtable></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-90">
\begin{split}
J&=\frac{1}{2m}\sum_{i=1}^{m} (h_\theta(x^{(i)})-y^{(i)}) \cdot(h_\theta(x^{(i)})-y^{(i)})\\
&=\frac{1}{2m}(X\theta-y)^T(X\theta-y)
\end{split}
</script></span> <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-91-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;J&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1607" style="width: 0.59em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.481em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.751em, 1000.48em, 2.742em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1608"><span class="mi" id="MathJax-Span-1609" style="font-family: STIXGeneral; font-style: italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.047em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.084em; border-left: 0px solid; width: 0px; height: 0.91em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>J</mi></math></span></span><script type="math/tex" id="MathJax-Element-91">J</script></span> 最后的结果是一个数，但也可以理解为<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-92-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;&amp;#x00D7;&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1610" style="width: 2.513em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.137em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.728em, 1002.03em, 2.749em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1611"><span class="mn" id="MathJax-Span-1612" style="font-family: STIXGeneral;">1</span><span class="mo" id="MathJax-Span-1613" style="font-family: STIXGeneral; padding-left: 0.25em;">×</span><span class="mn" id="MathJax-Span-1614" style="font-family: STIXGeneral; padding-left: 0.25em;">1</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.092em; border-left: 0px solid; width: 0px; height: 0.945em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn><mo>×</mo><mn>1</mn></math></span></span><script type="math/tex" id="MathJax-Element-92">1\times 1</script></span> 的矩阵，我们知道要求得损失函数的极小值需要令 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-93-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;J&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1615" style="width: 0.59em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.481em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.751em, 1000.48em, 2.742em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1616"><span class="mi" id="MathJax-Span-1617" style="font-family: STIXGeneral; font-style: italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.047em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.084em; border-left: 0px solid; width: 0px; height: 0.91em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>J</mi></math></span></span><script type="math/tex" id="MathJax-Element-93">J</script></span> 的梯度为0，由于 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-94-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1618" style="width: 0.911em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.748em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.963em, 1000.73em, 2.733em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1619"><span class="mi" id="MathJax-Span-1620" style="font-family: STIXGeneral; font-style: italic;">m</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.073em; border-left: 0px solid; width: 0px; height: 0.651em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>m</mi></math></span></span><script type="math/tex" id="MathJax-Element-94">m</script></span> 并不影响 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-95-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;J&lt;/mi&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1621" style="width: 0.59em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.481em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.751em, 1000.48em, 2.742em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1622"><span class="mi" id="MathJax-Span-1623" style="font-family: STIXGeneral; font-style: italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.047em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.084em; border-left: 0px solid; width: 0px; height: 0.91em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>J</mi></math></span></span><script type="math/tex" id="MathJax-Element-95">J</script></span> 的极值点，我们对 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-96-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1624" style="width: 9.511em; display: inline-block;"><span style="display: inline-block; position: relative; width: 8.12em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.516em, 1008.07em, 3.113em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1625"><span class="mfrac" id="MathJax-Span-1626"><span style="display: inline-block; position: relative; width: 0.474em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.368em, 1000.28em, 4.167em, -1000em); top: -4.417em; left: 50%; margin-left: -0.177em;"><span class="mn" id="MathJax-Span-1627" style="font-size: 70.7%; font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.368em, 1000.34em, 4.167em, -1000em); top: -3.618em; left: 50%; margin-left: -0.177em;"><span class="mn" id="MathJax-Span-1628" style="font-size: 70.7%; font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1000.47em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 0.474em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="mo" id="MathJax-Span-1629" style="font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1630" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1631" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1632" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="mi" id="MathJax-Span-1633" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.25em;">y</span><span class="msubsup" id="MathJax-Span-1634"><span style="display: inline-block; position: relative; width: 0.856em; height: 0px;"><span style="position: absolute; clip: rect(3.17em, 1000.29em, 4.344em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1635" style="font-family: STIXGeneral;">)</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.333em;"><span class="mi" id="MathJax-Span-1636" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1637" style="font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1638" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1639" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1640" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="mi" id="MathJax-Span-1641" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.25em;">y</span><span class="mo" id="MathJax-Span-1642" style="font-family: STIXGeneral;">)</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.517em; border-left: 0px solid; width: 0px; height: 1.618em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mn>1</mn><mn>2</mn></mfrac><mo stretchy="false">(</mo><mi>X</mi><mi>θ</mi><mo>−</mo><mi>y</mi><msup><mo stretchy="false">)</mo><mi>T</mi></msup><mo stretchy="false">(</mo><mi>X</mi><mi>θ</mi><mo>−</mo><mi>y</mi><mo stretchy="false">)</mo></math></span></span><script type="math/tex" id="MathJax-Element-96">\frac{1}{2}(X\theta-y)^T(X\theta-y)</script></span> 求极值即可： <span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-97-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mtable columnalign=&quot;right left&quot; rowspacing=&quot;3pt&quot; columnspacing=&quot;0em&quot; displaystyle=&quot;true&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2207;&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/msub&gt;&lt;mi&gt;J&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;&lt;msub&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2207;&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd /&gt;&lt;mtd&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;&lt;msub&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2207;&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd /&gt;&lt;mtd&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;&lt;msub&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2207;&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd /&gt;&lt;mtd&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;&lt;msub&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2207;&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd /&gt;&lt;mtd&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;&lt;msub&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2207;&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/msub&gt;&lt;mtext&gt;tr&lt;/mtext&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd /&gt;&lt;mtd&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;&lt;msub&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2207;&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mtext&gt;tr&lt;/mtext&gt;&lt;msup&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mtext&gt;tr&lt;/mtext&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd /&gt;&lt;mtd&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd /&gt;&lt;mtd&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1643" style="width: 22.599em; display: inline-block;"><span style="display: inline-block; position: relative; width: 19.284em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(-7.023em, 1019.07em, 11.01em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-1644"><span class="mtable" id="MathJax-Span-1645" style="padding-right: 0.167em; padding-left: 0.167em;"><span style="display: inline-block; position: relative; width: 18.936em; height: 0px;"><span style="position: absolute; clip: rect(9.266em, 1001.65em, 26.402em, -1000em); top: -17.842em; left: 0em;"><span style="display: inline-block; position: relative; width: 1.646em; height: 0px;"><span style="position: absolute; clip: rect(3.184em, 1001.65em, 4.324em, -1000em); top: -11.76em; right: 0em;"><span class="mtd" id="MathJax-Span-1646"><span class="mrow" id="MathJax-Span-1647"><span class="msubsup" id="MathJax-Span-1648"><span style="display: inline-block; position: relative; width: 1.155em; height: 0px;"><span style="position: absolute; clip: rect(3.184em, 1000.67em, 4.179em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1649" style="font-family: STIXGeneral;">∇</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.731em;"><span class="mi" id="MathJax-Span-1650" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1651" style="font-family: STIXGeneral; font-style: italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.047em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.846em, 1000em, 4.167em, -1000em); top: -9.384em; right: 0em;"><span class="mtd" id="MathJax-Span-1676"><span class="mrow" id="MathJax-Span-1677"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.846em, 1000em, 4.167em, -1000em); top: -7.008em; right: 0em;"><span class="mtd" id="MathJax-Span-1706"><span class="mrow" id="MathJax-Span-1707"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.846em, 1000em, 4.167em, -1000em); top: -4.632em; right: 0em;"><span class="mtd" id="MathJax-Span-1747"><span class="mrow" id="MathJax-Span-1748"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.846em, 1000em, 4.167em, -1000em); top: -2.256em; right: 0em;"><span class="mtd" id="MathJax-Span-1783"><span class="mrow" id="MathJax-Span-1784"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.846em, 1000em, 4.167em, -1000em); top: 0.12em; right: 0em;"><span class="mtd" id="MathJax-Span-1820"><span class="mrow" id="MathJax-Span-1821"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.846em, 1000em, 4.167em, -1000em); top: 2.496em; right: 0em;"><span class="mtd" id="MathJax-Span-1851"><span class="mrow" id="MathJax-Span-1852"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.846em, 1000em, 4.167em, -1000em); top: 4.394em; right: 0em;"><span class="mtd" id="MathJax-Span-1874"><span class="mrow" id="MathJax-Span-1875"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 17.842em;"></span></span><span style="position: absolute; clip: rect(9.43em, 1017.24em, 27.463em, -1000em); top: -18.697em; left: 1.646em;"><span style="display: inline-block; position: relative; width: 17.29em; height: 0px;"><span style="position: absolute; clip: rect(2.494em, 1010.69em, 4.853em, -1000em); top: -11.76em; left: 0em;"><span class="mtd" id="MathJax-Span-1652"><span class="mrow" id="MathJax-Span-1653"><span class="mi" id="MathJax-Span-1654"></span><span class="mo" id="MathJax-Span-1655" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mfrac" id="MathJax-Span-1656" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 0.62em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.17em, 1000.39em, 4.167em, -1000em); top: -4.683em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1657" style="font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.17em, 1000.47em, 4.167em, -1000em); top: -3.32em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1658" style="font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1000.62em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 0.62em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1659"><span style="display: inline-block; position: relative; width: 1.155em; height: 0px;"><span style="position: absolute; clip: rect(3.184em, 1000.67em, 4.179em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1660" style="font-family: STIXGeneral;">∇</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.731em;"><span class="mi" id="MathJax-Span-1661" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1662" style="font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1663" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1664" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1665" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="mi" id="MathJax-Span-1666" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.25em;">y</span><span class="msubsup" id="MathJax-Span-1667"><span style="display: inline-block; position: relative; width: 0.856em; height: 0px;"><span style="position: absolute; clip: rect(3.17em, 1000.29em, 4.344em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1668" style="font-family: STIXGeneral;">)</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.333em;"><span class="mi" id="MathJax-Span-1669" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1670" style="font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1671" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1672" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1673" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="mi" id="MathJax-Span-1674" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.25em;">y</span><span class="mo" id="MathJax-Span-1675" style="font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.494em, 1011.85em, 4.853em, -1000em); top: -9.384em; left: 0em;"><span class="mtd" id="MathJax-Span-1678"><span class="mrow" id="MathJax-Span-1679"><span class="mi" id="MathJax-Span-1680"></span><span class="mo" id="MathJax-Span-1681" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mfrac" id="MathJax-Span-1682" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 0.62em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.17em, 1000.39em, 4.167em, -1000em); top: -4.683em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1683" style="font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.17em, 1000.47em, 4.167em, -1000em); top: -3.32em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1684" style="font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1000.62em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 0.62em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1685"><span style="display: inline-block; position: relative; width: 1.155em; height: 0px;"><span style="position: absolute; clip: rect(3.184em, 1000.67em, 4.179em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1686" style="font-family: STIXGeneral;">∇</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.731em;"><span class="mi" id="MathJax-Span-1687" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1688" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1689"><span style="display: inline-block; position: relative; width: 1.071em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1690" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.548em;"><span class="mi" id="MathJax-Span-1691" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1692"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1693" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-1694" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1695" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-1696" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 0.967em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1697" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.444em;"><span class="mi" id="MathJax-Span-1698" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1699" style="font-family: STIXGeneral;">)</span><span class="mo" id="MathJax-Span-1700" style="font-family: STIXGeneral;">(</span><span class="mi" id="MathJax-Span-1701" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1702" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1703" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="mi" id="MathJax-Span-1704" style="font-family: STIXGeneral; font-style: italic; padding-left: 0.25em;">y</span><span class="mo" id="MathJax-Span-1705" style="font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.494em, 1017.24em, 4.853em, -1000em); top: -7.008em; left: 0em;"><span class="mtd" id="MathJax-Span-1708"><span class="mrow" id="MathJax-Span-1709"><span class="mi" id="MathJax-Span-1710"></span><span class="mo" id="MathJax-Span-1711" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mfrac" id="MathJax-Span-1712" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 0.62em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.17em, 1000.39em, 4.167em, -1000em); top: -4.683em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1713" style="font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.17em, 1000.47em, 4.167em, -1000em); top: -3.32em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1714" style="font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1000.62em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 0.62em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1715"><span style="display: inline-block; position: relative; width: 1.155em; height: 0px;"><span style="position: absolute; clip: rect(3.184em, 1000.67em, 4.179em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1716" style="font-family: STIXGeneral;">∇</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.731em;"><span class="mi" id="MathJax-Span-1717" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1718" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1719"><span style="display: inline-block; position: relative; width: 1.071em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1720" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.548em;"><span class="mi" id="MathJax-Span-1721" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1722"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1723" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-1724" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1725" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1726" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1727" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-1728" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 0.967em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1729" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.444em;"><span class="mi" id="MathJax-Span-1730" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1731" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1732" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1733" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-1734" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 1.071em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1735" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.548em;"><span class="mi" id="MathJax-Span-1736" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1737"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1738" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-1739" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1740" style="font-family: STIXGeneral; font-style: italic;">y</span><span class="mo" id="MathJax-Span-1741" style="font-family: STIXGeneral; padding-left: 0.25em;">+</span><span class="msubsup" id="MathJax-Span-1742" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 0.967em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1743" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.444em;"><span class="mi" id="MathJax-Span-1744" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1745" style="font-family: STIXGeneral; font-style: italic;">y</span><span class="mo" id="MathJax-Span-1746" style="font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.494em, 1014.65em, 4.853em, -1000em); top: -4.632em; left: 0em;"><span class="mtd" id="MathJax-Span-1749"><span class="mrow" id="MathJax-Span-1750"><span class="mi" id="MathJax-Span-1751"></span><span class="mo" id="MathJax-Span-1752" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mfrac" id="MathJax-Span-1753" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 0.62em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.17em, 1000.39em, 4.167em, -1000em); top: -4.683em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1754" style="font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.17em, 1000.47em, 4.167em, -1000em); top: -3.32em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1755" style="font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1000.62em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 0.62em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1756"><span style="display: inline-block; position: relative; width: 1.155em; height: 0px;"><span style="position: absolute; clip: rect(3.184em, 1000.67em, 4.179em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1757" style="font-family: STIXGeneral;">∇</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.731em;"><span class="mi" id="MathJax-Span-1758" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1759" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1760"><span style="display: inline-block; position: relative; width: 1.071em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1761" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.548em;"><span class="mi" id="MathJax-Span-1762" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1763"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1764" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-1765" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1766" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1767" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1768" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-1769" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 0.967em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1770" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.444em;"><span class="mi" id="MathJax-Span-1771" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1772" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1773" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1774" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-1775" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 1.071em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1776" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.548em;"><span class="mi" id="MathJax-Span-1777" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1778"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1779" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-1780" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1781" style="font-family: STIXGeneral; font-style: italic;">y</span><span class="mo" id="MathJax-Span-1782" style="font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.494em, 1015.26em, 4.853em, -1000em); top: -2.256em; left: 0em;"><span class="mtd" id="MathJax-Span-1785"><span class="mrow" id="MathJax-Span-1786"><span class="mi" id="MathJax-Span-1787"></span><span class="mo" id="MathJax-Span-1788" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mfrac" id="MathJax-Span-1789" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 0.62em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.17em, 1000.39em, 4.167em, -1000em); top: -4.683em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1790" style="font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.17em, 1000.47em, 4.167em, -1000em); top: -3.32em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1791" style="font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1000.62em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 0.62em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1792"><span style="display: inline-block; position: relative; width: 1.155em; height: 0px;"><span style="position: absolute; clip: rect(3.184em, 1000.67em, 4.179em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1793" style="font-family: STIXGeneral;">∇</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.731em;"><span class="mi" id="MathJax-Span-1794" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mtext" id="MathJax-Span-1795" style="font-family: STIXGeneral;">tr</span><span class="mo" id="MathJax-Span-1796" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1797"><span style="display: inline-block; position: relative; width: 1.071em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1798" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.548em;"><span class="mi" id="MathJax-Span-1799" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1800"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1801" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-1802" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1803" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1804" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1805" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-1806" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 0.967em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1807" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.444em;"><span class="mi" id="MathJax-Span-1808" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1809" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1810" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1811" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-1812" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 1.071em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1813" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.548em;"><span class="mi" id="MathJax-Span-1814" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1815"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1816" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-1817" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1818" style="font-family: STIXGeneral; font-style: italic;">y</span><span class="mo" id="MathJax-Span-1819" style="font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.494em, 1012.43em, 4.853em, -1000em); top: 0.12em; left: 0em;"><span class="mtd" id="MathJax-Span-1822"><span class="mrow" id="MathJax-Span-1823"><span class="mi" id="MathJax-Span-1824"></span><span class="mo" id="MathJax-Span-1825" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mfrac" id="MathJax-Span-1826" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 0.62em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.17em, 1000.39em, 4.167em, -1000em); top: -4.683em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1827" style="font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.17em, 1000.47em, 4.167em, -1000em); top: -3.32em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1828" style="font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1000.62em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 0.62em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1829"><span style="display: inline-block; position: relative; width: 1.155em; height: 0px;"><span style="position: absolute; clip: rect(3.184em, 1000.67em, 4.179em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1830" style="font-family: STIXGeneral;">∇</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.731em;"><span class="mi" id="MathJax-Span-1831" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1832" style="font-family: STIXGeneral;">(</span><span class="mtext" id="MathJax-Span-1833" style="font-family: STIXGeneral;">tr</span><span class="msubsup" id="MathJax-Span-1834"><span style="display: inline-block; position: relative; width: 1.071em; height: 0px;"><span style="position: absolute; clip: rect(3.168em, 1000.49em, 4.178em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1835" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.548em;"><span class="mi" id="MathJax-Span-1836" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1837"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1838" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-1839" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1840" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1841" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1842" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="mn" id="MathJax-Span-1843" style="font-family: STIXGeneral; padding-left: 0.25em;">2</span><span class="mtext" id="MathJax-Span-1844" style="font-family: STIXGeneral;">tr</span><span class="msubsup" id="MathJax-Span-1845"><span style="display: inline-block; position: relative; width: 0.967em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.43em, 4.373em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1846" style="font-family: STIXGeneral; font-style: italic;">y</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.444em;"><span class="mi" id="MathJax-Span-1847" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1848" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1849" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1850" style="font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.494em, 1009.05em, 4.853em, -1000em); top: 2.496em; left: 0em;"><span class="mtd" id="MathJax-Span-1853"><span class="mrow" id="MathJax-Span-1854"><span class="mi" id="MathJax-Span-1855"></span><span class="mo" id="MathJax-Span-1856" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mfrac" id="MathJax-Span-1857" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 0.62em; height: 0px; margin-right: 0.12em; margin-left: 0.12em;"><span style="position: absolute; clip: rect(3.17em, 1000.39em, 4.167em, -1000em); top: -4.683em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1858" style="font-family: STIXGeneral;">1</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.17em, 1000.47em, 4.167em, -1000em); top: -3.32em; left: 50%; margin-left: -0.25em;"><span class="mn" id="MathJax-Span-1859" style="font-family: STIXGeneral;">2</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(0.841em, 1000.62em, 1.229em, -1000em); top: -1.288em; left: 0em;"><span style="display: inline-block; overflow: hidden; vertical-align: 0em; border-top: 1.3px solid; width: 0.62em; height: 0px;"></span><span style="display: inline-block; width: 0px; height: 1.068em;"></span></span></span></span><span class="mo" id="MathJax-Span-1860" style="font-family: STIXGeneral;">(</span><span class="mn" id="MathJax-Span-1861" style="font-family: STIXGeneral;">2</span><span class="msubsup" id="MathJax-Span-1862"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1863" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-1864" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1865" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1866" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1867" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="mn" id="MathJax-Span-1868" style="font-family: STIXGeneral; padding-left: 0.25em;">2</span><span class="msubsup" id="MathJax-Span-1869"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1870" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-1871" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1872" style="font-family: STIXGeneral; font-style: italic;">y</span><span class="mo" id="MathJax-Span-1873" style="font-family: STIXGeneral;">)</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.972em, 1006.55em, 4.373em, -1000em); top: 4.394em; left: 0em;"><span class="mtd" id="MathJax-Span-1876"><span class="mrow" id="MathJax-Span-1877"><span class="mi" id="MathJax-Span-1878"></span><span class="mo" id="MathJax-Span-1879" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="msubsup" id="MathJax-Span-1880" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1881" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-1882" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1883" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1884" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1885" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-1886" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1887" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-1888" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1889" style="font-family: STIXGeneral; font-style: italic;">y</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 18.697em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -10.132em; border-left: 0px solid; width: 0px; height: 20.848em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mtable columnalign="right left" rowspacing="3pt" columnspacing="0em" displaystyle="true"><mtr><mtd><msub><mi mathvariant="normal">∇</mi><mi>θ</mi></msub><mi>J</mi></mtd><mtd><mi></mi><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msub><mi mathvariant="normal">∇</mi><mi>θ</mi></msub><mo stretchy="false">(</mo><mi>X</mi><mi>θ</mi><mo>−</mo><mi>y</mi><msup><mo stretchy="false">)</mo><mi>T</mi></msup><mo stretchy="false">(</mo><mi>X</mi><mi>θ</mi><mo>−</mo><mi>y</mi><mo stretchy="false">)</mo></mtd></mtr><mtr><mtd></mtd><mtd><mi></mi><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msub><mi mathvariant="normal">∇</mi><mi>θ</mi></msub><mo stretchy="false">(</mo><msup><mi>θ</mi><mi>T</mi></msup><msup><mi>X</mi><mi>T</mi></msup><mo>−</mo><msup><mi>y</mi><mi>T</mi></msup><mo stretchy="false">)</mo><mo stretchy="false">(</mo><mi>X</mi><mi>θ</mi><mo>−</mo><mi>y</mi><mo stretchy="false">)</mo></mtd></mtr><mtr><mtd></mtd><mtd><mi></mi><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msub><mi mathvariant="normal">∇</mi><mi>θ</mi></msub><mo stretchy="false">(</mo><msup><mi>θ</mi><mi>T</mi></msup><msup><mi>X</mi><mi>T</mi></msup><mi>X</mi><mi>θ</mi><mo>−</mo><msup><mi>y</mi><mi>T</mi></msup><mi>X</mi><mi>θ</mi><mo>−</mo><msup><mi>θ</mi><mi>T</mi></msup><msup><mi>X</mi><mi>T</mi></msup><mi>y</mi><mo>+</mo><msup><mi>y</mi><mi>T</mi></msup><mi>y</mi><mo stretchy="false">)</mo></mtd></mtr><mtr><mtd></mtd><mtd><mi></mi><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msub><mi mathvariant="normal">∇</mi><mi>θ</mi></msub><mo stretchy="false">(</mo><msup><mi>θ</mi><mi>T</mi></msup><msup><mi>X</mi><mi>T</mi></msup><mi>X</mi><mi>θ</mi><mo>−</mo><msup><mi>y</mi><mi>T</mi></msup><mi>X</mi><mi>θ</mi><mo>−</mo><msup><mi>θ</mi><mi>T</mi></msup><msup><mi>X</mi><mi>T</mi></msup><mi>y</mi><mo stretchy="false">)</mo></mtd></mtr><mtr><mtd></mtd><mtd><mi></mi><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msub><mi mathvariant="normal">∇</mi><mi>θ</mi></msub><mtext>tr</mtext><mo stretchy="false">(</mo><msup><mi>θ</mi><mi>T</mi></msup><msup><mi>X</mi><mi>T</mi></msup><mi>X</mi><mi>θ</mi><mo>−</mo><msup><mi>y</mi><mi>T</mi></msup><mi>X</mi><mi>θ</mi><mo>−</mo><msup><mi>θ</mi><mi>T</mi></msup><msup><mi>X</mi><mi>T</mi></msup><mi>y</mi><mo stretchy="false">)</mo></mtd></mtr><mtr><mtd></mtd><mtd><mi></mi><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msub><mi mathvariant="normal">∇</mi><mi>θ</mi></msub><mo stretchy="false">(</mo><mtext>tr</mtext><msup><mi>θ</mi><mi>T</mi></msup><msup><mi>X</mi><mi>T</mi></msup><mi>X</mi><mi>θ</mi><mo>−</mo><mn>2</mn><mtext>tr</mtext><msup><mi>y</mi><mi>T</mi></msup><mi>X</mi><mi>θ</mi><mo stretchy="false">)</mo></mtd></mtr><mtr><mtd></mtd><mtd><mi></mi><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mo stretchy="false">(</mo><mn>2</mn><msup><mi>X</mi><mi>T</mi></msup><mi>X</mi><mi>θ</mi><mo>−</mo><mn>2</mn><msup><mi>X</mi><mi>T</mi></msup><mi>y</mi><mo stretchy="false">)</mo></mtd></mtr><mtr><mtd></mtd><mtd><mi></mi><mo>=</mo><msup><mi>X</mi><mi>T</mi></msup><mi>X</mi><mi>θ</mi><mo>−</mo><msup><mi>X</mi><mi>T</mi></msup><mi>y</mi></mtd></mtr></mtable></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-97">
\begin{split}
\nabla_\theta J&=\frac{1}{2}\nabla_\theta(X\theta-y)^T(X\theta-y)\\
&=\frac{1}{2}\nabla_\theta(\theta^TX^T-y^T)(X\theta-y)\\
&=\frac{1}{2}\nabla_\theta(\theta^TX^TX\theta-y^TX\theta-\theta^TX^Ty+y^Ty)\\
&=\frac{1}{2}\nabla_\theta(\theta^TX^TX\theta-y^TX\theta-\theta^TX^Ty)\\
&=\frac{1}{2}\nabla_\theta \text{tr}(\theta^TX^TX\theta-y^TX\theta-\theta^TX^Ty)\\
&=\frac{1}{2}\nabla_\theta (\text{tr} \theta^TX^TX\theta-2\text{tr} y^TX\theta)\\
&=\frac{1}{2}(2X^TX\theta-2X^Ty)\\
&=X^TX\theta-X^Ty\\
\end{split}
</script></span> ps. 上式的推导过程需要用到矩阵的迹（trace）相关性质以及矩阵函数求导的知识，限于本文的篇幅这里不再介绍，有需要的话可以参阅 Andrew Ng 的<a href="http://cs229.stanford.edu/notes/cs229-notes1.ps" target="_blank" rel="external">讲义</a>。</p>
<p>令 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-98-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;msub&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2207;&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;/msub&gt;&lt;mi&gt;J&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1890" style="width: 4.063em; display: inline-block;"><span style="display: inline-block; position: relative; width: 3.472em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.728em, 1003.45em, 2.882em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1891"><span class="msubsup" id="MathJax-Span-1892"><span style="display: inline-block; position: relative; width: 1.155em; height: 0px;"><span style="position: absolute; clip: rect(3.184em, 1000.67em, 4.179em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1893" style="font-family: STIXGeneral;">∇</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -3.856em; left: 0.731em;"><span class="mi" id="MathJax-Span-1894" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.01em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1895" style="font-family: STIXGeneral; font-style: italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.047em;"></span></span><span class="mo" id="MathJax-Span-1896" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mn" id="MathJax-Span-1897" style="font-family: STIXGeneral; padding-left: 0.313em;">0</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.247em; border-left: 0px solid; width: 0px; height: 1.101em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi mathvariant="normal">∇</mi><mi>θ</mi></msub><mi>J</mi><mo>=</mo><mn>0</mn></math></span></span><script type="math/tex" id="MathJax-Element-98">\nabla_\theta J=0</script></span>，可以得到下式： <span class="math display has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><div class="MathJax_Display" style="text-align: center;"><span class="MathJax" id="MathJax-Element-99-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mtable columnalign=&quot;right left&quot; rowspacing=&quot;3pt&quot; columnspacing=&quot;0em&quot; displaystyle=&quot;true&quot;&gt;&lt;mtr&gt;&lt;mtd /&gt;&lt;mtd&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mo stretchy=&quot;false&quot;&gt;&amp;#x21D4;&lt;/mo&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mo stretchy=&quot;false&quot;&gt;&amp;#x21D4;&lt;/mo&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;&amp;#x03B8;&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1898" style="width: 9.778em; display: inline-block;"><span style="display: inline-block; position: relative; width: 8.333em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(-0.133em, 1008.14em, 4.12em, -1000em); top: -2.244em; left: 0em;"><span class="mrow" id="MathJax-Span-1899"><span class="mtable" id="MathJax-Span-1900" style="padding-right: 0.167em; padding-left: 0.167em;"><span style="display: inline-block; position: relative; width: 7.997em; height: 0px;"><span style="position: absolute; clip: rect(2.504em, 1000.91em, 5.687em, -1000em); top: -4.006em; left: 0em;"><span style="display: inline-block; position: relative; width: 0.926em; height: 0px;"><span style="position: absolute; clip: rect(3.846em, 1000em, 4.167em, -1000em); top: -5.348em; right: 0em;"><span class="mtd" id="MathJax-Span-1901"><span class="mrow" id="MathJax-Span-1902"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.329em, 1000.91em, 4.177em, -1000em); top: -3.93em; right: 0em;"><span class="mtd" id="MathJax-Span-1917"><span class="mrow" id="MathJax-Span-1918"><span class="mo" id="MathJax-Span-1919" style="font-family: STIXGeneral;">⇔</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(3.329em, 1000.91em, 4.177em, -1000em); top: -2.496em; right: 0em;"><span class="mtd" id="MathJax-Span-1932"><span class="mrow" id="MathJax-Span-1933"><span class="mo" id="MathJax-Span-1934" style="font-family: STIXGeneral;">⇔</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.538em, 1007.05em, 6.791em, -1000em); top: -4.915em; left: 0.926em;"><span style="display: inline-block; position: relative; width: 7.071em; height: 0px;"><span style="position: absolute; clip: rect(2.972em, 1007.05em, 4.373em, -1000em); top: -5.348em; left: 0em;"><span class="mtd" id="MathJax-Span-1903"><span class="mrow" id="MathJax-Span-1904"><span class="msubsup" id="MathJax-Span-1905"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1906" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-1907" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1908" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1909" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1910" style="font-family: STIXGeneral; padding-left: 0.25em;">−</span><span class="msubsup" id="MathJax-Span-1911" style="padding-left: 0.25em;"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1912" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-1913" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1914" style="font-family: STIXGeneral; font-style: italic;">y</span><span class="mo" id="MathJax-Span-1915" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mn" id="MathJax-Span-1916" style="font-family: STIXGeneral; padding-left: 0.313em;">0</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.972em, 1005.37em, 4.373em, -1000em); top: -3.93em; left: 0em;"><span class="mtd" id="MathJax-Span-1920"><span class="mrow" id="MathJax-Span-1921"><span class="msubsup" id="MathJax-Span-1922"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1923" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-1924" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1925" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="mi" id="MathJax-Span-1926" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1927" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="msubsup" id="MathJax-Span-1928" style="padding-left: 0.313em;"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1929" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-1930" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1931" style="font-family: STIXGeneral; font-style: italic;">y</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; clip: rect(2.955em, 1006.95em, 4.373em, -1000em); top: -2.496em; left: 0em;"><span class="mtd" id="MathJax-Span-1935"><span class="mrow" id="MathJax-Span-1936"><span class="mi" id="MathJax-Span-1937" style="font-family: STIXGeneral; font-style: italic;">θ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.014em;"></span></span><span class="mo" id="MathJax-Span-1938" style="font-family: STIXGeneral; padding-left: 0.313em;">=</span><span class="mo" id="MathJax-Span-1939" style="font-family: STIXGeneral; padding-left: 0.313em;">(</span><span class="msubsup" id="MathJax-Span-1940"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1941" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-1942" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1943" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="msubsup" id="MathJax-Span-1944"><span style="display: inline-block; position: relative; width: 1.246em; height: 0px;"><span style="position: absolute; clip: rect(3.17em, 1000.29em, 4.344em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1945" style="font-family: STIXGeneral;">)</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.333em;"><span class="texatom" id="MathJax-Span-1946"><span class="mrow" id="MathJax-Span-1947"><span class="mo" id="MathJax-Span-1948" style="font-size: 70.7%; font-family: STIXGeneral;">−</span><span class="mn" id="MathJax-Span-1949" style="font-size: 70.7%; font-family: STIXGeneral;">1</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1950"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1951" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.419em; left: 0.718em;"><span class="mi" id="MathJax-Span-1952" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1953" style="font-family: STIXGeneral; font-style: italic;">y</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.915em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.244em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -2.071em; border-left: 0px solid; width: 0px; height: 4.727em;"></span></span></nobr><span class="MJX_Assistive_MathML MJX_Assistive_MathML_Block" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mtable columnalign="right left" rowspacing="3pt" columnspacing="0em" displaystyle="true"><mtr><mtd></mtd><mtd><msup><mi>X</mi><mi>T</mi></msup><mi>X</mi><mi>θ</mi><mo>−</mo><msup><mi>X</mi><mi>T</mi></msup><mi>y</mi><mo>=</mo><mn>0</mn></mtd></mtr><mtr><mtd><mo stretchy="false">⇔</mo></mtd><mtd><msup><mi>X</mi><mi>T</mi></msup><mi>X</mi><mi>θ</mi><mo>=</mo><msup><mi>X</mi><mi>T</mi></msup><mi>y</mi></mtd></mtr><mtr><mtd><mo stretchy="false">⇔</mo></mtd><mtd><mi>θ</mi><mo>=</mo><mo stretchy="false">(</mo><msup><mi>X</mi><mi>T</mi></msup><mi>X</mi><msup><mo stretchy="false">)</mo><mrow class="MJX-TeXAtom-ORD"><mo>−</mo><mn>1</mn></mrow></msup><msup><mi>X</mi><mi>T</mi></msup><mi>y</mi></mtd></mtr></mtable></math></span></span></div><script type="math/tex; mode=display" id="MathJax-Element-99">
\begin{split}
&X^TX\theta-X^Ty=0\\
\Leftrightarrow &X^TX\theta=X^Ty\\
\Leftrightarrow&\theta=(X^TX)^{-1}X^Ty\\
\end{split}
</script></span> 正规方程求得的是解析解，无需迭代，也不需要进行 feature 
scaling，看上去简直完美，相比之下梯度下降算法毫无可取之处？理想丰满抵不过现实残酷，求解正规方程需要求矩阵的逆，学过线性代数的同学都知道不
是所有的矩阵都能求逆，而且求逆也是一个很花时间的过程（<span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-100-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mi&gt;T&lt;/mi&gt;&lt;/msup&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mrow class=&quot;MJX-TeXAtom-ORD&quot;&gt;&lt;mo&gt;&amp;#x2212;&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1954" style="width: 4.063em; display: inline-block;"><span style="display: inline-block; position: relative; width: 3.472em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.563em, 1003.47em, 2.901em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1955"><span class="mo" id="MathJax-Span-1956" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1957"><span style="display: inline-block; position: relative; width: 1.241em; height: 0px;"><span style="position: absolute; clip: rect(3.193em, 1000.66em, 4.167em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1958" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.718em;"><span class="mi" id="MathJax-Span-1959" style="font-size: 70.7%; font-family: STIXGeneral; font-style: italic;">T<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mi" id="MathJax-Span-1960" style="font-family: STIXGeneral; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.044em;"></span></span><span class="msubsup" id="MathJax-Span-1961"><span style="display: inline-block; position: relative; width: 1.246em; height: 0px;"><span style="position: absolute; clip: rect(3.17em, 1000.29em, 4.344em, -1000em); top: -4.006em; left: 0em;"><span class="mo" id="MathJax-Span-1962" style="font-family: STIXGeneral;">)</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.333em;"><span class="texatom" id="MathJax-Span-1963"><span class="mrow" id="MathJax-Span-1964"><span class="mo" id="MathJax-Span-1965" style="font-size: 70.7%; font-family: STIXGeneral;">−</span><span class="mn" id="MathJax-Span-1966" style="font-size: 70.7%; font-family: STIXGeneral;">1</span></span></span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.27em; border-left: 0px solid; width: 0px; height: 1.316em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mo stretchy="false">(</mo><msup><mi>X</mi><mi>T</mi></msup><mi>X</mi><msup><mo stretchy="false">)</mo><mrow class="MJX-TeXAtom-ORD"><mo>−</mo><mn>1</mn></mrow></msup></math></span></span><script type="math/tex" id="MathJax-Element-100">(X^TX)^{-1}</script></span> 的求解复杂度为 <span class="math inline has-jax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-101-Frame" tabindex="0" style="position: relative;" data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;o&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/math&gt;" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1967" style="width: 2.46em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.083em; height: 0px; font-size: 117%;"><span style="position: absolute; clip: rect(1.563em, 1002.04em, 2.901em, -1000em); top: -2.564em; left: 0em;"><span class="mrow" id="MathJax-Span-1968"><span class="mi" id="MathJax-Span-1969" style="font-family: STIXGeneral; font-style: italic;">o</span><span class="mo" id="MathJax-Span-1970" style="font-family: STIXGeneral;">(</span><span class="msubsup" id="MathJax-Span-1971"><span style="display: inline-block; position: relative; width: 0.929em; height: 0px;"><span style="position: absolute; clip: rect(3.405em, 1000.47em, 4.176em, -1000em); top: -4.006em; left: 0em;"><span class="mi" id="MathJax-Span-1972" style="font-family: STIXGeneral; font-style: italic;">n</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span><span style="position: absolute; top: -4.369em; left: 0.5em;"><span class="mn" id="MathJax-Span-1973" style="font-size: 70.7%; font-family: STIXGeneral;">3</span><span style="display: inline-block; width: 0px; height: 4.006em;"></span></span></span></span><span class="mo" id="MathJax-Span-1974" style="font-family: STIXGeneral;">)</span></span><span style="display: inline-block; width: 0px; height: 2.564em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.27em; border-left: 0px solid; width: 0px; height: 1.316em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>o</mi><mo stretchy="false">(</mo><msup><mi>n</mi><mn>3</mn></msup><mo stretchy="false">)</mo></math></span></span><script type="math/tex" id="MathJax-Element-101">o(n^3)</script></span>），在矩阵很大时，求逆的计算量往往大于梯度下降算法，因此实际问题还是以梯度下降这种迭代方法为主，当研究对象的特征较小时可以考虑使用正规方程求解。</p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="http://fangs.in/tags/stats/" rel="tag"># Stats</a>
          
            <a href="http://fangs.in/tags/machinelearning/" rel="tag"># MachineLearning</a>
          
            <a href="http://fangs.in/tags/linearregression/" rel="tag"># LinearRegression</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="http://fangs.in/post/thinkstats/svm0/" rel="next" title="我所理解的 SVM（支持向量机）- 1">
                <i class="fa fa-chevron-left"></i> 我所理解的 SVM（支持向量机）- 1
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="http://fangs.in/post/thinkstats/svm1/" rel="prev" title="我所理解的SVM(支持向量机)2——核函数的应用">
                我所理解的SVM(支持向量机)2——核函数的应用 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div id="disqus_thread">
        <noscript>
          Please enable JavaScript to view the
          <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a>
        </noscript>
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first" style="top: 5px; transform: rotateZ(-45deg); width: 100%;"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle" style="opacity: 0;"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last" style="top: -5px; transform: rotateZ(45deg); width: 100%;"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar sidebar-active" style="display: block; width: 320px;">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element" style="opacity: 1; display: block; transform: translateX(0px);">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            Overview
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope="" itemtype="http://schema.org/Person" style="opacity: 1; display: block; transform: translateX(0px);">
          <img class="site-author-image" itemprop="image" src="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/avatar.jpg" alt="Cesc Fangs">
          <p class="site-author-name" itemprop="name">Cesc Fangs</p>
           
              <p class="site-description motion-element" itemprop="description" style="opacity: 1; display: block; transform: translateX(0px);">南山有部队，北海有火锅</p>
          
        </div>
        <nav class="site-state motion-element" style="opacity: 1; display: block; transform: translateX(0px);">

          
            <div class="site-state-item site-state-posts">
              <a href="http://fangs.in/archives/">
                <span class="site-state-item-count">27</span>
                <span class="site-state-item-name">posts</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-categories">
              
                <span class="site-state-item-count">6</span>
                <span class="site-state-item-name">categories</span>
              
            </div>
          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="http://fangs.in/tags/index.html">
                <span class="site-state-item-count">21</span>
                <span class="site-state-item-name">tags</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element" style="opacity: 1; display: block; transform: translateX(0px);">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/Cescfangs" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                    
                      GitHub
                    
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://weibo.com/Cescfangs" target="_blank" title="Weibo">
                  
                    <i class="fa fa-fw fa-weibo"></i>
                  
                    
                      Weibo
                    
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://www.zhihu.com/people/cescfangs" target="_blank" title="Zhihu">
                  
                    <i class="fa fa-fw fa-bookmark-o"></i>
                  
                    
                      Zhihu
                    
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://t.me/cescfangs" target="_blank" title="Telegram">
                  
                    <i class="fa fa-fw fa-telegram"></i>
                  
                    
                      Telegram
                    
                </a>
              </span>
            
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active" style="opacity: 1; display: block; transform: translateX(0px);">
          <div class="post-toc" style="max-height: 828px; width: calc(100% + 15px);">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3 active active-current"><a class="nav-link" href="#线性回归快速过一遍"><span class="nav-number">1.</span> <span class="nav-text">线性回归：快速过一遍</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#多变量的线性回归"><span class="nav-number">2.</span> <span class="nav-text">多变量的线性回归</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#损失函数是怎么来的"><span class="nav-number">3.</span> <span class="nav-text">损失函数是怎么来的</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#为什么梯度下降法能减小损失函数"><span class="nav-number">4.</span> <span class="nav-text">为什么梯度下降法能减小损失函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#正规方程-normal-equation"><span class="nav-number">5.</span> <span class="nav-text">正规方程 Normal Equation</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">
  
  ©  2015 - 
  <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Cesc Fangs</span>
</div>


<div class="powered-by">
  Powered by <a class="theme-link" href="https://hexo.io/">Hexo</a>
</div>

<div class="theme-info">
  Theme -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>
</div>


        

        
      </div>
    </footer>

    
      <div class="back-to-top back-to-top-on">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/index.js"></script>

  
  <script type="text/javascript" src="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/fastclick.js"></script>

  
  <script type="text/javascript" src="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/jquery.js"></script>

  
  <script type="text/javascript" src="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/velocity.js"></script>

  
  <script type="text/javascript" src="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/velocity_002.js"></script>

  
  <script type="text/javascript" src="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/jquery_002.js"></script>


  


  <script type="text/javascript" src="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/utils.js"></script>

  <script type="text/javascript" src="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/motion.js"></script>



  
  

  
  <script type="text/javascript" src="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/scrollspy.js"></script>
<script type="text/javascript" src="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/post-details.js"></script>



  


  <script type="text/javascript" src="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/bootstrap.js"></script>



  


  

    
      <script id="dsq-count-scr" src="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/count.js" async=""></script>
    

    
      <script type="text/javascript">
        var disqus_config = function () {
          this.page.url = 'http://fangs.in/post/thinkstats/ml_0_linearregression/';
          this.page.identifier = 'post/thinkstats/ml_0_linearregression/';
          this.page.title = '从线性回归说起';
        };
        var d = document, s = d.createElement('script');
        s.src = 'https://Cescfangs.disqus.com/embed.js';
        s.setAttribute('data-timestamp', '' + +new Date());
        (d.head || d.body).appendChild(s);
      </script>
    

  




	





  








  





  

  

  

  
  
    <script type="text/x-mathjax-config;executed=true">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config;executed=true">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script type="text/javascript" src="%E4%BB%8E%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E8%AF%B4%E8%B5%B7%20|%20Cesco%20%20a%20minimal%20blog_files/latest.js"></script>
  


  

  



<div style="position: absolute; width: 0px; height: 0px; overflow: hidden; padding: 0px; border: 0px none; margin: 0px;"><div id="MathJax_Font_Test" style="position: absolute; visibility: hidden; top: 0px; left: 0px; width: auto; padding: 0px; border: 0px none; margin: 0px; white-space: nowrap; text-align: left; text-indent: 0px; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; font-size: 40px; font-weight: normal; font-style: normal; font-size-adjust: none; font-family: STIXSizeOneSym, sans-serif;"></div></div></body></html>